Home › forums › Using CanvasJS › Draw an arrow on a graph
This topic contains 3 replies, has 2 voices, and was last updated by Emeric 1 year, 7 months ago.
I have a problem:
I have a graph with 2 markers (i can move them by drag & drop) and I would like to see the distance with an arrow between them. I have that at the moment (and have the distance in the console):
I drew an arrow in canvas:
But I don’t know how to add her to my graph in order to see it between my markers.
Do some one have an idea in order to help me ?
Thank you in advance !
Is that possible ?
You can get the context of canvas using chart.ctx as shown in this example. However, re-rendering the chart will clear user drawn shapes. So, it would be better to just overlay another transparent canvas on top of chart and draw on it instead.
That’s perfect thank you !
You must be logged in to reply to this topic.