Event listener for a Line as a whole rather than data points

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 Laura Gilbert on 31st January 2014
I would like to trigger an event when a line is clicked; e.g. highlight the line and pop up a tooltip.

I can only currently seem to engage mouse events when I'm over a data point on the line.

Is it possible to trigger an event at any point of a line object, not just the verteces?

I'm using spline: true if that makes any difference.

Many thanks,

Laura
Posted by Richard on 31st January 2014
Hi there,

There's no "native" way to make the Line fully clickable but what you can do is add a drawing API poly object that sits on top of the line by using the obj.coordsSpline coordinates. There's a demo here:

www.rgraph.net/tests/spline-clickable.html

And there's a button to make the poly transparent too.




Richard, RGraph Support
www.rgraph.net
Please link to the RGraph website
Posted by Laura Gilbert on 31st January 2014
Clever, thank you.

Add a reply




« Back to message list