Home forums Using CanvasJS Draw an arrow on a graph

This topic contains 3 replies, has 2 voices, and was last updated by  Emeric 4 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #15316

    Emeric
    Member

    Hello !

    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 !

    #15322

    Emeric
    Member

    Is that possible ?

    #15330

    Bivek Singh
    Moderator

    @emeric,

    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.

    —-
    Bivek Singh,
    Team CanvasJS

    #15336

    Emeric
    Member

    That’s perfect thank you !

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.