[RGRAPH SUPPORT] How do I add crosshairs to a Line chart?

How do I add crosshairs to a Line chart?

Post a reply
Posted by Lorri at 18:24 on 31st December 2020
I have a Line chart that I'd like to add crosshairs when the user clicks or hovers over a point.

Thanks.

Posted by Richard at 18:37 on 31st December 2020
The easiest way is to just use the crosshairs* properties. With the Line chart it only works with the mousemove event.

I've made you an example and it's here:

https://codepen.io/rgraph/pen/LYRdbwJ

NOTE:

Initially I said that you had to use the Scatter chart for this - but that is only if you wish to get an X/Y coordinate pair (since the Scatter chart has an X axis scale). This example shows a Line chart with crosshairs.

Post a reply

What's your name?
What do you want to say?