How to get Bar chart object/label on bar's click event


« 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 Praveen on 21st February 2013
Hi I have 3 bar charts on my page and have added click events on first chart.
I am able to get bar's index, which I have clicked using-
var index = shape['index'];

but I need to know about the label on the same index.
tried "e.target.__object__" it has reference to last chart, but I need first chart object.

How I can get the labels or chart object on click event?
Thanks.
Posted by RGraph support on 21st February 2013
Hi there,

You need to use the ObjectRegistry methods. The ObjectRegistry is a record of al of the RGraph objects that have been created. The .getObjectByType() may be most useful - though this method has changed recently so if you upgrade you may need to update your code.

www.rgraph.net/docs/api.html#objectregistry


Richard, RGraph Support

1 Year Priority Support now reduced to £299:
   www.rgraph.net/support

Add a reply

 




« Back to message list
RGraph on social media