chart.xkcd icon indicating copy to clipboard operation
chart.xkcd copied to clipboard

toggled between visible and invisible

Open timqian opened this issue 4 years ago • 5 comments

allows user to toggle visible and invisible of different labels

Example

Usage example

https://github.com/timqian/star-history/issues/62

timqian avatar Sep 09 '19 08:09 timqian

If no one is assigned or working I wouldn't mind giving it a go

bikingbadger avatar Sep 11 '19 08:09 bikingbadger

@bikingbadger Glad to hear that. I think no one is working on this~

timqian avatar Sep 11 '19 08:09 timqian

Thanks @timqian It's actually something that I was looking when using the chart.

bikingbadger avatar Sep 11 '19 08:09 bikingbadger

I've managed to catch the click on the actual rectangle of the legend. What do you think is the best way to change the dataset of the graph or fire a function on the Line class to change the underlying data.

I had an idea of adding a parameter to the dataset like this:

datasets: [{
      label: 'Plan',
      data: [30, 70, 200, 300, 500, 800, 1500, 2900, 5000, 8000],
      hidden: false,
    }

That way the a function of the class can just toggle the hidden value and a user can setup the table with datasets hidden but shown in the legend. I've pretty new to SVG's and getting around Classes so hope I'm not asking silly questions although I think the method of hwo to show or hide the series could be used commonly between the various charts by way of extending a parent Chart class

bikingbadger avatar Sep 11 '19 12:09 bikingbadger

@bikingbadger “a user can setup the table with datasets hidden but shown in the legend”, this sounds interesting to me, but I am not sure if this feature is necessary, I don't see this option in other maturer chart libs likechart.js or echarts

timqian avatar Sep 12 '19 05:09 timqian