Home forums Using CanvasJS reverse stepLine

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #20324

    larry
    Member

    Hello,

    Im having a realtime stepline chart in angular,
    when I play data forward, chart looks fine,
    when I play data backward, line between points (stepline) is not the same as forward play

    example:
    1. {x:4,y:5} , {x:5,y:7} //(line go right and then go up)
    2. {x:5,y:7} , {x:4,y:5} //(line go left and then go down)

    is there a way to draw step line same in both examples? ( in example 2 , line should go down and then go left).

    Thank you,
    Larry

    #20331

    Indranil Deo
    Member

    @larry,

    Chart is rendered based on the sequence of datapoints given. If {x:5,y:7} is given first then {x:4,y:5}, it renders x:5 and then x:4. To avoid such issues, you can sort dataPoints before rendering the chart. Please take a look at this jsfiddle.

    ___________
    Indranil Deo,
    Team CanvasJS

    #20341

    larry
    Member

    Thanks:)

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

You must be logged in to reply to this topic.