Home Forums Chart Support Draw a line over canvas chart

Draw a line over canvas chart

Viewing 9 posts - 1 through 9 (of 9 total)
  • #22783

    Is there any way to draw a line over canvas chart on mouse events?

    #22785

    @prem123,
    Are you looking for something like this.

    Also take a look at gallery example on draggable column chart.


    Vishwas R
    Team CanvasJS

    #22788

    No i don’t want to move Datapoints, i just want to draw a simple line over chart

    #22789

    I just to want to draw a line _______________________________________________ like this

    #22790

    @prem123,

    You can attach mouse events to chart-container and draw line on top of chart-canvas based on mouse events. Please take a look at this JSFiddle where line will be drawn from the coordinates of mousedown and mouseup events.


    Vishwas R
    Team CanvasJS

    #22791

    Is there any way to draw lines using tools supported by Canvas js

    #22797

    @prem123,

    Sorry, drawing on chart is not available as an inbuilt feature in CanvasJS as of now. However with few lines of code, you can achieve it as shown in the JSFiddle shared.


    Vishwas R
    Team CanvasJS

    #39125

    @vishwas I need help on something similar to above, my query is that I want to display polygons like shapes on a scatter chart. Pls refer Original Question. I’m getting data in form of an array of objects e.g [{x:4,y:9.0}], so for let’s say a polygon of sides 5 I’ll have 5 points. How can I show them as a shaded region over a scatter plot?

    #39148

    @eshan_23,

    As addressed by @adithya-menon in the original thread, you can either use area or range-area charts to create polygon shapes. Please refer to this JSFiddle for an example on drawing hexagon using area chart.


    Vishwas R
    Team CanvasJS

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

You must be logged in to reply to this topic.