CodeYellowBV / chartist-plugin-legend

Legend plugin for Chartist.js.
https://codeyellowbv.github.io/chartist-plugin-legend/
Other
116 stars 62 forks source link

Not able to add data whilst series are hidden from the legend #46

Open jokohoko opened 7 years ago

jokohoko commented 7 years ago

When hiding a series in the chart using the legend buttons i think what happens is that the array of data gets copied and the selected series gets removed? In my application i constantly add new data to the chart and thus when hiding a series that series is no longer available in the data array to add new data to.

Im am not sure how to solve it so i will just leave the buttons feature out for now, but would it not be possible to add a flag to the data array instead of just taking the data out and back in all the time?

tarekis commented 7 years ago

That's indeed what happens, to be honest, I never understood why it's implemented like this. The event handler is here, you can see what happens in the code. I guess if you want that changed you could propose a PR to fix it.

tarekis commented 6 years ago

@jokohoko Are you intending on writing a PR for this use-case and is this still relevant?

jokohoko commented 6 years ago

I'm sorry, i was not able to improve this workflow and went for an alternative method whereby i have 2 graphs and just switch beween them. So i no longer use the legend filtering option.

tarekis commented 6 years ago

@jokohoko Thanks, in this case, I will address this issue somewhen in the future.