Some questions about the key

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« 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 Todd Hoffman on 14th June 2013
First of all, I'd like to say thanks for a great graphing/charting library. In just a couple of days I've been able to do some really cool things with this library.

I'm trying to do a few things with the key that are a bit non-standard. The easiest thing to do is show you a picture:

googledrive.com/host/0B68OmJ790lUpdVV3NXN1bFJVVUE/RGraphKeyQuestions.png

So, I am attempting to use the key colors as a secondary categorization on a stacked bar chart. I've been able to do this using the sequential colors option to control the bar colors, and then specify the key.colors and key arrays myself. But, I'd also really like to turn on the interactive key functionality. With the way I've specified the keys, the default mapping for the interactive key does not line up correctly with my bars. Is there any easy way that I can intercept the key click event and change the bar indexes that get passed to highlighting code?

It would also be very nice if the key had better handling of very long tooltips through wrapped text or ellipses and tooltips. A key title would also be a nice feature for the next release.

Thanks in advance for any help you can give on these issues.

Posted by RGraph support on 16th June 2013
Hi there,


There's no events currently for the interactive key but I can add these along with the ability to set the highlight colors to transparent.

For long keys you can add ellipses if the text is longer than a certain length or number of characters - possibly referencing a full label which is part of your page beneath the chart. If you do this then the label will be real, selectable, text.

For the key title - the drawing API is definitely the right option. Presumably you're using that in-conjunction with the key coords - obj.coords.key

Richard, RGraph support

Add a reply




« Back to message list