This is a migrated thread and some comments may be shown as answers.

Programmatically Hide Series

2 Answers 1204 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 15 Jul 2014, 11:14 PM
Hey guys,

Currently if you have a chart and you display the legend, you are able to click items in the legend to show/hide them.  Was wondering if there is a way to do this without the legend displaying, say maybe by clicking a button.

The below example shows the basic chart with a legend and how it can toggle the series by clicking it in the legend:

http://trykendoui.telerik.com/aPUR/2

2 Answers, 1 is accepted

Sort by
0
Accepted
Hristo Germanov
Telerik team
answered on 17 Jul 2014, 03:23 PM
Hi Daniel,

You have two options:
1) You can use _legendItemClick with first parameter seriesIndex:
$("#chart").getKendoChart()._legendItemClick(0);
2) Set visible false to the series that you want to hide and call chart's redraw():
$("#chart").getKendoChart().options.series[0].visible = false;
$("#chart").getKendoChart().redraw();

I hope this helps. 

Regards,
Hristo Germanov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Daniel
Top achievements
Rank 1
answered on 26 Aug 2014, 04:47 PM
Worked like a charm! Thanks!
Tags
Charts
Asked by
Daniel
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or