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

incorrect x order after using chart.load() #771

Closed
DemersM opened this issue Feb 14, 2019 · 1 comment
Closed

incorrect x order after using chart.load() #771

DemersM opened this issue Feb 14, 2019 · 1 comment

Comments

@DemersM
Copy link

DemersM commented Feb 14, 2019

On a legend item click, I load a sorted dataset into the chart. However, the x are not re-ordered along with the new dataset.

See: https://jsfiddle.net/o7eu59h2/1/

For instance, the initial data is the following:

var data = [
  ["x", "year1", "year2", "year3", "year4", "year5"],
  ["Male", 1, 3, 2, 4, 1],
  ["Female", 2, null, 1, 3, 2],
];

If, I load the following dataset with a different x order, the x order in the chart is not updated:

var sortedDataByMale = [
  ["x", "year1", "year5", "year3", "year2", "year4"],
  ["Male", 1, 1, 2, 3, 4],
  ["Female", 2, 2, 1, null, 3]
];

Edit:
I notice in my jsFiddle above that the sorted dataset is loaded when clicking on "Male" legend item but not when clicking on "Female". This is something I cannot understand.

@DemersM DemersM changed the title incorect x order after using chart.load() incorrect x order after using chart.load() Feb 14, 2019
@DemersM
Copy link
Author

DemersM commented Feb 14, 2019

I see that I have to use the categories parameter in the chart.load function to make it works. Sorry my mistake.

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

No branches or pull requests

1 participant