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

Allow animation to/from hidden datasets #1833

Closed
etimberg opened this issue Dec 25, 2015 · 9 comments · Fixed by #7055
Closed

Allow animation to/from hidden datasets #1833

etimberg opened this issue Dec 25, 2015 · 9 comments · Fixed by #7055

Comments

@etimberg
Copy link
Member

Requested in the comments of #1146

@piotrd
Copy link

piotrd commented Jul 13, 2016

Hi. Any progress on this one?

@etimberg
Copy link
Member Author

No progress has been made. I have a general idea of what needs to be done, but have not explored it

@WattsC-90
Copy link

WattsC-90 commented Sep 3, 2016

a workaround:

self.graph.datasets[0].hidden = true;
or
self.graph.datasets[0].hidden = true;

then

use the update() method on the chart to change the state..

also, to tie it to a checkbox (as i am doing currently):

self.graph.datasets[0].hidden = document.getElementById('seriesHide').checked; self.chart.update();
note, i am using knockout.js for my backend data binding, so you may find the self. unnecessary.

@hexx870206helen
Copy link

@WattsC-90 ...Hey ...would you please provide more details about how to use the checkbox to control hiding/display the data on the chart? I am working this task but feel confused how to pass the boolean value to the 'datasets[0].hidden' and update the chart?

@WattsC-90
Copy link

@hexx870206helen I am assuming you are working for the Chart.js repository and therefore my answer would be:

I would probably have an option to enable series hiding on the chart globally, which enables checkboxes next to the key labels which have an event, on change or similar. When those checkboxes change state, the series gets hidden, probably by the onchange event handler simply doing what I mentioned above, changing the series to hidden and calling update.

Hopefully this helps, if not, I can explain a bit more? I am trying to describe the behaviour, as I don't want to comment on implementation given I am not involved in the repository source code.

@hexx870206helen
Copy link

@WattsC-90 hey...that's enough...appreciate your suggestions...thanks a lot

@WattsC-90
Copy link

@hexx870206helen I have had a dig around and found my old codepen from when I was doing this work.. take a look here: http://codepen.io/chriswatts90/pen/PGovpO and it shows you how to link the checkbox in with the graph, its very rough code, but should get you started! there is no data though as it points to a json-server (nodejs) endpoint to get its data. But i figure you dont need the data, just showing how it links the bits together.

@etimberg etimberg modified the milestones: Version 2.7, Version 2.6 Apr 16, 2017
@simonbrunel simonbrunel modified the milestones: Version 2.8, Version 2.7 Aug 16, 2017
@ABleas
Copy link

ABleas commented Jul 4, 2018

I see this feature is intended for v2.8. I look forward to its arrival :)

@simonbrunel simonbrunel removed this from the Version 2.7.3 milestone Oct 15, 2018
@alex-benoit
Copy link

@simonbrunel @etimberg hi there! very interested in this feature - is this part of 2.7 or 2.8? where can I find the docs if so? cc @ChristianBell1995

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

8 participants