Getting label from onclick event

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 Tarun on 22nd April 2013
Hi,


    can you please tell how can we find out the label name rather than value using onclick event


Thanks
Posted by RGraph support on 22nd April 2013
Hi there,

Sorry I don't understand the question.



Richard, RGraph Support

5 developer license with Priority support for £299:
   www.rgraph.net/license#five-developer
Posted by Tarun on 22nd April 2013
    pie.onclick = function (e, shape)
     {
       obj = e.target.__object__
       alert(obj.data);
     }

Now alert(obj.data) will only return the values but i need names. The names given to that values,
like [2,4,5] are values, [john, marry, smith] are names. Now i am getting only [2,4,5] but i need john if i click the slice of john's
Posted by RGraph support on 22nd April 2013
Hi there,

In that case you can use the getter:

var names = obj.Get('chart.labels');

PS Please remember to link to the RGraph website - cheers!

Richard, RGraph Support

5 developer license with Priority support for £299:
   www.rgraph.net/license#five-developer
Posted by Tarun on 22nd April 2013
thanx for help

Add a reply




« Back to message list