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

sortby dose not work? #22599

Closed
wendy2017 opened this issue Jan 5, 2023 · 16 comments
Closed

sortby dose not work? #22599

wendy2017 opened this issue Jan 5, 2023 · 16 comments
Assignees
Labels
#bug Bug report

Comments

@wendy2017
Copy link

image

@wendy2017 wendy2017 added the #bug Bug report label Jan 5, 2023
@zhaoyongjie
Copy link
Member

@wendy2017 Could you provide more detail for this case? for example, 1) what do you expect to sort? 2) the SQL for the chart.

@sfirke
Copy link
Member

sfirke commented Jan 10, 2023

What version of Superset are you running? I find bar chart v2 sorting to be incomplete in 2.0.1, but there is a PR merged into main branch that looks like it should fix that (#21993) if you try the latest version.

@wendy2017
Copy link
Author

for bar:
Use sortby to select a metric in the y-axis. It is expected that the y-axis can be arranged in a certain order, but it does not take effect in practice;
but Use x-axis sort by to take effect

@wendy2017
Copy link
Author

i have another question:
for interface(api/v1/chart/data?form_data=xxx),what's purpose of post-processing:{is_sort_index:number}

@wendy2017
Copy link
Author

Why sortby can't implement the function of xaxis sortby?i want to know the reason

@zhaoyongjie
Copy link
Member

for bar: Use sortby to select a metric in the y-axis. It is expected that the y-axis can be arranged in a certain order, but it does not take effect in practice; but Use x-axis sort by to take effect

Hi @wendy2017
I can't reproduce the issue. I make a screen recording for the axis sort with the y-axis and x-axis.

sort.by.y.axis.mov

@wendy2017
Copy link
Author

Can I use sortby instead of X-Axis sortby to realize the functions in video? Or can you showthe use of sortby

@zhaoyongjie
Copy link
Member

Can I use sortby instead of X-Axis sortby to realize the functions in video? Or can you showthe use of sortby

the Sort By control affects Order By clause in the SQL while the X-Axis Sort By controls the order of the results in the query result.

@wendy2017
Copy link
Author

I don't understand
Use Sortby, but there is no change in eccharts
Is there any example that can demonstrate the sortby controls

@zhaoyongjie
Copy link
Member

the Sort By control affects SQL instead of charts.

image

I don't understand Use Sortby, but there is no change in eccharts Is there any example that can demonstrate the sortby controls

@wendy2017
Copy link
Author

According to what your image,Will your data be sorted by AVG(”Sales")?

@wendy2017
Copy link
Author

image

i tried to do like your image,but my data is not sorted by AVG(TOTAL_CNT)

@zhaoyongjie
Copy link
Member

image

i tried to do like your image,but my data is not sorted by AVG(TOTAL_CNT)

try to add AVG(TOTAL_CNT) into x-axis sort by control because the data in results panel was pivot table rather than raw table.

@Cmagno13
Copy link

Sorting on the 2v bar graph is not working. Any suggestions for correction.

000000image

@sfirke
Copy link
Member

sfirke commented Mar 21, 2023

A couple of PRs related to bar chart sorting were recently merged onto master branch, it would be good if someone could see if this behavior continues with latest.

@yousoph
Copy link
Member

yousoph commented Jul 26, 2023

Can't repro this on the latest master - if this is still happening please reopen or create a new issue with detailed repro steps. Thanks!

@yousoph yousoph closed this as completed Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report
Projects
None yet
Development

No branches or pull requests

5 participants