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

trigger legendItem events programatically

2 Answers 79 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Glenn Boothe
Top achievements
Rank 1
Glenn Boothe asked on 09 Dec 2015, 05:56 PM

I have multiple charts with the same legend. I've hidden the legend in all but the first chart. I want the first chart's legend to control the rest of the charts' legends. The only way I've found to do this is to call "private" methods on the charts: _legendItemHover and _legendItemClick. This works pretty good, but the hover is a little bit off. When your mouse leaves a legend item it will un-highlight the item in the main chart, but not the secondary charts.

 

I've created a jsFiddle to demonstrate.

http://jsfiddle.net/zmmzxhek/

 

My guess is that the 'this' keyword is being used in the private method and that's throwing it off. I haven't done any research on that, just an educated guess. I'll be checking that now but wanted to see if anyone else had any other input.

2 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 11 Dec 2015, 04:51 PM
Hello,

There are actually public methods that can be use for the same purpose: However, since there isn't an event that can be used to remove the highlight I would suggest to render the legend outside of the charts - example.

Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Glenn Boothe
Top achievements
Rank 1
answered on 11 Dec 2015, 09:18 PM
Worked great, thanks Daniel!
Tags
Charts
Asked by
Glenn Boothe
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Glenn Boothe
Top achievements
Rank 1
Share this question
or