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

Feature: sort by Y values charts that have a single value per series #410

Merged
merged 2 commits into from
Apr 26, 2015

Conversation

stanhu
Copy link
Contributor

@stanhu stanhu commented Apr 22, 2015

We have a lot of bar charts that should be sorted by y values. This pull request adds a "sortY" option.

screen shot 2015-04-21 at 10 24 02 pm

@stanhu stanhu force-pushed the sort-by-y-values branch from 54ca8b6 to fd056ed Compare April 22, 2015 05:52
@@ -325,6 +325,36 @@
series = seriesCopy;
}

if (chartOptions['sortY'] === true || chartOptions['sortY'] === undefined) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chartOptions['sortY'] === undefined means that "old" queries without this setting will default to enabling this, right? I prefer that we don't do this, to avoid confusion and unexpected results for existing charts/users.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, that makes sense.

@arikfr
Copy link
Member

arikfr commented Apr 26, 2015

Btw, until this merged, if you uncheck the "Sort X values" option of the chart, it will preserve the order the results returned from the database, so you can already sort by y value if you change the query.

See this as an example:
http://demo.redash.io/queries/232/source#add

Just play with the "Sort X values" option.

@stanhu
Copy link
Contributor Author

stanhu commented Apr 26, 2015

Right, the sort by X functionality doesn't do what we need here. As mentioned above, we have a table that looks like:

Test Development Production
100 200 300

@arikfr arikfr changed the title Add support to sort by y values for charts that have a single value per series Feature: sort by Y values charts that have a single value per series Apr 26, 2015
arikfr added a commit that referenced this pull request Apr 26, 2015
Feature: sort by Y values charts that have a single value per series
@arikfr arikfr merged commit 513ef50 into getredash:master Apr 26, 2015
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 this pull request may close these issues.

2 participants