I have multiple series running on a graph of type line . now my client requires that the visibility of each of the series be externally controlled. that is for example if i have a div or li list of series somewhere on the page clicking them i should be able to toggle the visibility of respective series on the graph . for example clicking <div>series A</div> should toggle the visibility of 'series A' on the graph.
I wonder if this is in the scope of the kendo dataviz
7 Answers, 1 is accepted
Thank you for contacting us.
You can try to remove one of your series and then you can call refresh().
the Telerik team
There is no documentation for this. When you create a chart you can access the series of the chart from chart.options. Then if you want to remove one of them you can use splice javacript method. After that you need to refresh your chart with the chart's refresh method.Kind regards,
the Telerik team
I want to achieve the same as Aboo, and i tried to solve it with this splice() method, and there is no problem to take out one of the series, but when I put it back, it doesn’t show correctly.
I made a workaround, trying to replace the series in the chart.options you can try it here: http://jsfiddle.net/mgeri/yPGxL/
What i see here is that the ponits are where they shold be, but it doesn't draw the lines. What did i forgot, or tried wrong?
Any improvements are welcome.
Another option is to play with the visual properties of the series. If you have a line chart, you can set the width = 0 to make that serie disappear.
In my case, I have a chart with 1 visible serie CSS and 1 optional State.
Create the chart with all series:
To make State invisible:
Opacity is another property to play with. The only disadvantage is that if you have a legend displayed, all series will show up.