Key labels


« 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 sam on 10th April 2014
is is possible to define labels to each value

here is example what i mean...

var bar1 = new RGraph.Bar('cvs', [[8,4,1],[4,8,8],[1,2,2],[3,3,4],[6,5,2],[5,8,8],[4,8,5]])
                 .set('key', ['Jim','Jack','Joseph'])
                 .set('key.interactive', true)
                 .set('labels', ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'])
                 .draw();


this way it adds key labels to each array first index
so Jim got first value from array[0][0] , [1][0], [2][0]....
i want define labels individual way like array[0][0] has own label and on array[1][0] has different
Posted by Richard on 10th April 2014
Hi there,

I don't think there's any easy way to do what you want. But if you're comfortable modifying the source you can add something to the interactiveKeyHighlight function in the Bar chart source. This function is what runs when you click a key entry and it highlights the relevant key entry.
Start by adding an alert like this inside the forEach loop and that will show you the coordinates for the rect that it draws:

$p(value[index]);




Richard
www.rgraph.net
If RGraph has helped you - please share the website - thanks!

Add a reply

 




« Back to message list
RGraph on social media