Bug description
Scatter chart X-axis custom formatting using D3 format syntax is not working for my scatter charts, despite having GENERIC_CHART_AXES enabled.
- Enable GENERIC_CHART_AXES feature flag.
- Create a scatter chart with a non-timeseries X-Axis data series.
- Select the "Customize" tab.
- X-axis formatting box still says "Time Format", enter a custom non-time D3 format (ie. .2f | $.2f).
- Click "Update Chart"
- Note that the configured x-axis format does not get applied to the chart.
Screenshots/recordings
Superset version
master / latest-dev
Python version
3.12
Node version
16
Browser
Chrome
Additional context
No response
Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Comment From: dosubot[bot]
Hey there, @OG-Foobarred! I'm here to help you with any bugs, questions, or contributions you have related to the issue you posted. Let's work together to solve this!
I found a similar unsolved discussion regarding the formatting of x-axis values when using the GENERIC_CHART_AXES
feature: Format x-axis values when using GENERIC_CHART_AXES [1]. Additionally, there was a closed issue related to custom SQL for the x-axis being broken, which was resolved by a pull request: fix(plugin-chart-echarts): support adhoc x-axis [2].
In your case, it seems that the custom D3 format syntax for non-timeseries data on the x-axis is not being applied as expected. This might be related to how Superset determines whether to apply a time format or a non-time format to the x-axis when the GENERIC_CHART_AXES
feature is enabled. Superset checks if the x-axis value is an ad-hoc column or a physical column and applies the appropriate format based on whether the column is marked as a datetime (is_dttm
) [3].
If the issue persists, it might be worth checking if the x-axis data is being correctly identified as non-temporal and ensuring that the custom format is compatible with the data type.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
Comment From: og-foobarred
@dosu I have verified that it is a physical column from the database/dataset and it is of numeric type and non-temporal.
Comment From: msyavuz
Hey @villebro, do you have an idea of what might be causing this?