Making Line Chart Line completely clickable

Share RGraph:   Share or Like RGraph on Facebook!

« 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 Jared B on 20th August 2013
The issue I am running into is with a line chart. Only at a data point is it clickable. I want to have the ability to mouse over any part of the line and it change my cursor and be clickable. Any suggestions would be greatly appreciated.
Posted by RGraph support on 21st August 2013
Hi there,

You can add a drawing API Poly object on top of the line and give that eithera tooltip or use its click/mousemove listeners. Similar to this:

www.rgraph.net/fiddle/view/a-filled-line-chart-thats-clickable

But instead of going through the coords and then down to the X axis and back, you'd gp through the coords - and then reverse over them. You'd probably want to offset the Y values by 1 or 2 so that the Poly object has some thickness. Also if you change the color of it (instead of it being transparent) it will make things easier as you'll be able to see it.




Richard, RGraph Support
Posted by RGraph support on 22nd August 2013
Hi there,

There's now a blog article about this (the third section) if you're interested:

www.rgraph.net/blog/2013/august/a-clickable-filled-line-chart.html

(it'll be live shortly)





Richard, RGraph Support

Add a reply




« Back to message list