-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sorting control not working on numeric x axis #26323
Comments
cc @villebro and @michael-s-molina since it's related to #26087 and some of the related follow ups |
@villebro I created this ECharts example to try possible configurations to fix this issue. You can see that the order of the Given the problems that we're facing with numerical x-axis, I'm leaning towards reverting all PRs related to that change and reopen #26034. WDYT? @sfirke for context. |
@yousoph we discussed this at length today with @michael-s-molina. In summary, I feel that outside of RTL, inverting a scalar x-axis doesn't really make sense, and is not something we've ever supported: temporal charts have always been assumed to flow from the left to the right. While we could consider adding a control for reversing x-axis for temporal and numerical x-axes*, sorting them by any other column doesn't really make sense, unless assuming them to be categorical first. So in this sense, the x-axis sorting control was not supposed to be present for numerical x-axes. This is, IMO, a bug. To address this, without breaking conflicting functionality in the 2.x and 3.x branches, I propose the following:
With regard to introducing RTL support, I think it's a great idea, but not something we probably can't take on right now, and is something that would likely require a huge overhaul of our UI. * If we really want to support inverted scalar axes, that's already supported in ECharts. So it's really just a question of adding yet another control for it. However, given how cluttered our control panels already are, and how niche this requirement likely is, I'm not sure this is something we should do before we thoroughly plan for official RTL support. |
@villebro the proposed solution makes sense to me! One thing I'd propose adding though - since before the fix in #26034, users were able to sort their numeric x-axis, could we mark any numeric x-axis with sorting applied as categorical and keep the sort by controls that were in place so that existing charts don't seem like they broke after the next fix? I think we'd have to look at both the sort ascending checkbox as well as the sort by dropdown, since the chart config could look something like this: |
@yousoph your suggestion makes sense to me, and I've rewritten the fix branch to work with charts that were saved prior to these changes. I expect to be opening the PR today as soon as I've updated tests etc. |
How to reproduce the bug
Vehicle Sales
dataset.quarter
as the X-Axis andcount(*)
as your metric.Expected results
Sorting should be updated properly
Actual results
Sort on the chart doesn't change and looks like the below with both ascending and descending sorting
Environment
(please complete the following information):
master
python --version
node -v
Checklist
Make sure to follow these steps before submitting your issue - thank you!
Additional context
CASTing the column to
varchar
will fix the issue, but it's not clear to the end user why the sorting wouldn't work without having to do thisThe text was updated successfully, but these errors were encountered: