Does RGraph have the ability to hide or show the legend?


« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Gaurav on 10th October 2013
Hi,

Is there a functionality to show/hide RGraph legends ?
Just like highcharts. (jsfiddle.net/gfNYk/5/)

Thanks
Gaurav
Posted by RGraph support on 10th October 2013
Hi there,

Yes you could do that. There's no built in way, but the easiest way would be to position drawing API rects over the keey coordinates (which are kept in obj.coordsKey) and then use the onclick events of those rects to change the colors of the main chart - making the relevant color transparent ( rgba(0,0,0,0) ).


Richard, RGraph Support
Posted by RGraph support on 10th October 2013
Hi there,

Also, you may find it easier to use the interactive key to highlight a line instead of hiding the others:

www.rgraph.net/docs/interactive-keys.html




Richard, RGraph Support
Posted by Gaurav on 16th October 2013
Hi,

I was not able to find the coordinates of the key where legends are drawn.

Please let me know how to get these values.

Thanks in advance
Posted by RGraph support on 16th October 2013
Hi there,

The coordinates of the key itself aren't kept but the coordinates for the text can be found in: obj.coords.key



Richard, RGraph Support
Posted by Gaurav on 22nd October 2013
Thanks for your help. I was able to achive what I was trying. Though when i draw rectangles on top of key texts, my annotations functionality stops working.
Am I missing something?

Thanks in Advance.
Posted by RGraph Support on 22nd October 2013
Hi there,


You will doubtless need to have either the dynamic rectangles or annotations because of the way that the objects are "stacked" on top of each other.




Richard, RGraph Support

Add a reply




« Back to message list