You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bar chart spilling out past x-axis on both ends #26254
Thanks for looking into this, I'm sorry to hear there's nothing in ECharts to help with this. This wasn't a problem in 3.0.0 so maybe there's a way forward? It's an unfortunate regression.
Manually set bounds don't provide a satisfactory experience here. If I set 2017 as my x-min I get weird whitespace and x-min = 2018 gets me the same as the bad chart I posted. 2017.5 looks okay but creates a silly "2017.5" label, and anyway if my data values are subject to change I would have to keep changing the bounds.
I think my best way forward for now is to cast the x-axis variable to a categorical (varchar). But I would love to see the 3.0.0 behavior return.
@michael-s-molina@sfirke IIUC, the plan was to add a note to UPDATING informing users that Superset won't automatically convert numerical x-axes to categorical, and that they should be manually cast to categorical to get the previous appearance? I feel blocking the release in anticipation of getting this improvement into ECharts first will be excessive. Therefore, if we really do feel like numerical x-axis support is too lacking in the current state, we should probably just roll back to always using categorical x-axis until the upstream change is in place?
I had mistakenly thought this issue was fixed so thank you for clarifying. As it's not, can we leave it open?
I agree this should not hold up the release of 3.1.0. If we can't fix this without changes in ECharts then it's a matter of which bug is better to live with, this or #26034. I think we keep this one, because there is the workaround of casting the variable to varchar (which I tested and works). I can cast the variables and replace as users report issues.
Thank you both for working on this. I noticed that compared to rc2, this only affects an unstacked bar chart with a dimension - when I stack it, it looks good in 3.1.0rc3. So there seems to be have been progress from the screenshots posted above by @michael-s-molina and in 26269 by @villebro showing single bars spilling over the sides.
I think we keep this one, because there is the workaround of casting the variable to varchar (which I tested and works). I can cast the variables and replace as users report issues.
Makes sense.
As it's not, can we leave it open?
Yes. The context in this discussion will also be useful for folks when they find this problem.
For anyone reading this thread, here's the summary about this issue:
There's a bug in ECharts when displaying numerical x-axis in bar charts. We'll work with the ECharts team to provide a solution.
While the solution is not available, you can follow the instructions in UPDATING.md
#26034: Fixes a problem where numeric x-axes were being treated as categorical values. As a consequence of that, the way labels are displayed might change given that ECharts has a different treatment for numerical and categorical values. To revert to the old behavior, users need to manually convert numerical columns to text so that they are treated as categories. Check #26159 for more details.
New fix method: in 3.0.3+ (where this problem first appears), users don't have to manually convert numerical columns to text - there is now a "force categorical" checkbox that instantly applies the fix to a chart 🎉 Implemented in #26404.
Reacted by Michael S. Molina, Viktor and Evan Rusackas
Can anyone verify whether bar charts still spill past the x-axis in Superset 5.0.0? @rusackas was hopeful the 5.0 release might resolve this. Please report back so we can close or continue tracking.
After #39141, which first appears in 6.1.0rc3, I am unchecking the "force categorical" chart with a numeric x-axis and the chart still looks good even without that box checked.
I wonder if we can get rid of the "force categorical" box now - after #39141, is it effectively always checked behind the scenes?
Looks like #26269 fixed the bars spilling past the x-axis when it merged. I think we can close this, but not sure if you agree, or also wanna tackle the force categorical thing before closing this out.
Thinning the herd time! #26269 switched the bar-chart x-axis to scale: true and fixed the spilling, so this looks resolved (enough) to me. Closing, but ping me to reopen if it's still off in a recent version.
Activity
michael-s-molina commentedon Dec 12, 2023
It looks like that's how ECharts displays the bar chart with numerical x-axis when
minis defined asdataMin.I searched ECharts docs but I was not able to find a configuration that would fix this. It looks like you need to manually set bounds.
sfirke commentedon Dec 12, 2023
Thanks for looking into this, I'm sorry to hear there's nothing in ECharts to help with this. This wasn't a problem in 3.0.0 so maybe there's a way forward? It's an unfortunate regression.
Manually set bounds don't provide a satisfactory experience here. If I set 2017 as my x-min I get weird whitespace and x-min = 2018 gets me the same as the bad chart I posted. 2017.5 looks okay but creates a silly "2017.5" label, and anyway if my data values are subject to change I would have to keep changing the bounds.
I think my best way forward for now is to cast the x-axis variable to a categorical (varchar). But I would love to see the 3.0.0 behavior return.
michael-s-molina commentedon Dec 12, 2023
@villebro do you think there's something we can do here?
@sfirke This would bring back the bug of treating numerical values as categories.
sfirke commentedon Dec 12, 2023
@michael-s-molina is that bug documented / can you link to it? 🙏EDIT: I see the regression you referenced, #26034michael-s-molina commentedon Dec 12, 2023
[Bug] Bar chart item overlap grid
sfirke commentedon Dec 19, 2023
This is persisting for me in 3.1.0rc3:

michael-s-molina commentedon Dec 19, 2023
@villebro It looks like
scalewill not be sufficient and we'll need to submit a fix to ECharts to unblock the releases.villebro commentedon Dec 19, 2023
@michael-s-molina @sfirke IIUC, the plan was to add a note to UPDATING informing users that Superset won't automatically convert numerical x-axes to categorical, and that they should be manually cast to categorical to get the previous appearance? I feel blocking the release in anticipation of getting this improvement into ECharts first will be excessive. Therefore, if we really do feel like numerical x-axis support is too lacking in the current state, we should probably just roll back to always using categorical x-axis until the upstream change is in place?
sfirke commentedon Dec 19, 2023
I had mistakenly thought this issue was fixed so thank you for clarifying. As it's not, can we leave it open?
I agree this should not hold up the release of 3.1.0. If we can't fix this without changes in ECharts then it's a matter of which bug is better to live with, this or #26034. I think we keep this one, because there is the workaround of casting the variable to varchar (which I tested and works). I can cast the variables and replace as users report issues.
Thank you both for working on this. I noticed that compared to rc2, this only affects an unstacked bar chart with a dimension - when I stack it, it looks good in 3.1.0rc3. So there seems to be have been progress from the screenshots posted above by @michael-s-molina and in 26269 by @villebro showing single bars spilling over the sides.
michael-s-molina commentedon Dec 19, 2023
Makes sense.
Yes. The context in this discussion will also be useful for folks when they find this problem.
michael-s-molina commentedon Dec 19, 2023
For anyone reading this thread, here's the summary about this issue:
There's a bug in ECharts when displaying numerical x-axis in bar charts. We'll work with the ECharts team to provide a solution.
While the solution is not available, you can follow the instructions in UPDATING.md
or use the x-axis truncation controls when applicable.
sfirke commentedon Jan 15, 2024
New fix method: in 3.0.3+ (where this problem first appears), users don't have to manually convert numerical columns to text - there is now a "force categorical" checkbox that instantly applies the fix to a chart 🎉 Implemented in #26404.
1 remaining item
rumbin commentedon May 13, 2024
Wouldn't this bring back #26034?
rusackas commentedon May 13, 2024
Oh... good question... probably so. :/
rusackas commentedon Mar 19, 2025
Is this still happening in 4.1.1?
sfirke commentedon Mar 19, 2025
Yes, here it is in 4.1.2rc1:
The "force categorical" still works as a workaround. I see no action in the linked eCharts issue so it makes sense this persists in Superset.
rusackas commentedon Jun 13, 2025
Did 5.0 fix it? 🤞
rusackas commentedon Mar 11, 2026
Can anyone verify whether bar charts still spill past the x-axis in Superset 5.0.0? @rusackas was hopeful the 5.0 release might resolve this. Please report back so we can close or continue tracking.
sfirke commentedon Mar 12, 2026
I can confirm this persists in 6.0.0, if I uncheck
Force categoricalit spills out on the left exactly as in my screenshot above.sfirke commentedon May 1, 2026
After #39141, which first appears in 6.1.0rc3, I am unchecking the "force categorical" chart with a numeric x-axis and the chart still looks good even without that box checked.
I wonder if we can get rid of the "force categorical" box now - after #39141, is it effectively always checked behind the scenes?
rusackas commentedon Jun 13, 2026
Looks like #26269 fixed the bars spilling past the x-axis when it merged. I think we can close this, but not sure if you agree, or also wanna tackle the force categorical thing before closing this out.
rusackas commentedon Jun 16, 2026
@sfirke your call on whether or not to close this one, just to @-mention you properly ;)
rusackas commentedon Jun 17, 2026
Thinning the herd time! #26269 switched the bar-chart x-axis to scale: true and fixed the spilling, so this looks resolved (enough) to me. Closing, but ping me to reopen if it's still off in a recent version.