Skip to content
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

[Regression] GENERIC_CHART_AXES: numeric x-axis treated as categorical values #26034

Closed
3 tasks
rumbin opened this issue Nov 20, 2023 · 7 comments · Fixed by #26087
Closed
3 tasks

[Regression] GENERIC_CHART_AXES: numeric x-axis treated as categorical values #26034

rumbin opened this issue Nov 20, 2023 · 7 comments · Fixed by #26087
Assignees

Comments

@rumbin
Copy link
Contributor

rumbin commented Nov 20, 2023

When using a numeric column as the generic x-axis, the x-axis values aren't linearly distributed along the x-axis but they are evenly distributed, just as if they were categorical values

How to reproduce the bug

  1. Have the GENERIC_CHART_AXES feature flag enabled
  2. Create a dataset or a SQLLab query with numerical columns, e.g.
select
  *
from (values
  (1,1)
  , (2,2)
  , (5,5)
  , (10,10)
) as v(x,y)
  1. Visualize the query/dataset as bar chart (or line chart)
  2. Use x as x-axis and, e.g., max(y) as y-axis
  3. See that the x-axis values are shown with equal spacing instead of the expected linear distribution of the x values

Expected results

This is what it should look like and what it did correctly in Superset 2.0.1:

image

Actual results

X-axis values are seemingly treated as categorical values:

image

Any distribution/scatter/histogram plots based on this functionality are actually unusable due to this bug.

Environment

(please complete the following information):

  • browser type and version:
  • superset version: 3.0.2rc1
  • python version: python --version
  • node.js version: node -v
  • any feature flags active:

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

Add any other context about the problem here.

@michael-s-molina
Copy link
Member

@villebro @zhaoyongjie Could you take a look at this one?

@villebro
Copy link
Member

I will take a look, thanks for reporting @rumbin

@WojtekWaga
Copy link

Hey @villebro I checked the backend response and it's identical in this respect. I fed the json from Superset 2.0.1 backend into Superset 3.0.2rc1 frontend and it also misinterprets XAxis type. This made me convinced it's a FE issue. It looks like the getAxisTime defaults to AxisType.category in this case whereas it should return AxisType.time.

@villebro
Copy link
Member

I was able to repro, investigating now

@rumbin
Copy link
Contributor Author

rumbin commented Nov 23, 2023

@villebro, we found a fix on our side. @WojtekWaga will report here tomorrow and/or provide a PR.

@villebro
Copy link
Member

@rumbin @WojtekWaga oops, I already opened a fix 🙁 Do you mind reviewing the PR #26087 to see if it's in line with the changes you were proposing?

@michael-s-molina
Copy link
Member

Thank you all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants