trigger legendItem events programatically

3 posts, 1 answers
  1. Glenn Boothe
    Glenn Boothe avatar
    21 posts
    Member since:
    Jul 2008

    Posted 09 Dec 2015 Link to this post

    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. Answer
    Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 11 Dec 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Glenn Boothe
    Glenn Boothe avatar
    21 posts
    Member since:
    Jul 2008

    Posted 11 Dec 2015 in reply to Daniel Link to this post

    Worked great, thanks Daniel!
Back to Top