Open shreyansh1910 opened 1 month ago
Hey @shreyansh1910! I'm here to help you with any bugs, questions, or contributions you have for Superset. Let's squash those bugs together!
A similar issue was reported and closed in this GitHub issue [1]. The problem is that the default time format is set to adaptive formatting (SMART_DATE_ID
), which means that unless explicitly changed, the adaptive formatting will be applied.
To resolve this, you need to change the time format setting in your chart configuration. Here is how you can do it:
In the chart configuration:
Modify the xAxisFormat
property in the formData
object to your desired format. For example:
formData={{
...
xAxisFormat: '%d/%m/%Y', // or any other desired format
...
}}
In the YAML configuration:
Change the x_axis_time_format
property to your desired format. For example:
x_axis_time_format: '%d/%m/%Y' # or any other desired format
This should allow you to apply a different time format to the X-axis of your bar chart [2][3][[4]](https://github.com/apache/superset/blob/master/superset/examples/configs/charts/Featured Charts/Mixed.yaml).
To continue talking to Dosu, mention @dosu.
@dosu where is this yaml file
The YAML file for changing the x_axis_time_format
property in Superset is located at superset/examples/configs/charts/Featured Charts/Mixed.yaml
.
In this file, the property is specified as:
x_axis_time_format: smart_date
[[1]](https://github.com/apache/superset/blob/master/superset/examples/configs/charts/Featured Charts/Mixed.yaml)
To continue talking to Dosu, mention @dosu.
@dosu I have same problem, so I'm going to do same thing. Do I have to change Both "1.chart configuration" and "2.YAML configuration"? Or Can I change just YAML file? And the example above is "Mixed File", But I have a problem with "Bar chart (viz_type: echarts_timeseries_bar)". So would it be correct to change the Bar.yaml file instead of Mixed.yaml?
Bug description
Bar chart X axis Time format is stuck to adaptive no other format is working
How to reproduce the bug
Create a bar chart with Time as x axis Try to change to other Time format
Screenshots/recordings
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist