Is there an event listener for an entire Line rather than just the data points?

« 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,

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:

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

Posted by Laura Gilbert on 31st January 2014
Clever, thank you.

Add a reply

« Back to message list