Home forums Report Bugs Line graph not correct

Tagged: 

This topic contains 3 replies, has 3 voices, and was last updated by  Danny 5 months, 3 weeks ago.

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

    arealperson
    Member

    Hi

    I tried to do a line graph with CanvasJS but it doesn’t draw the line in the correct order.

    http://jsfiddle.net/9h9ny0b6/1/

    It draws the line to May 2016 first than goes back and brings it to January 2015 instead of first connecting to January 2015 then going to the 2016 one.

    Please help

    Thanks

    #11319

    arealperson
    Member

    Also how is it possible to specify the ordering. I have an x axis with just labels that I would like to appear in a specific order. Ex. Fall 2015, Winter 2016, Spring 2016, Fall 2016, etc.

    I searched but i could not find a method… It puts the values out of order. The only method I could think of is to plot it via the date and override the labels afterwards.

    #11321

    Sanjoy
    Moderator

    In whichever order you provide dataPoints it will render in the same order.

    We don’t sort dataPoints before plotting. If required you have to sort dataPoints before rendering. Here is an example.

    #11322

    Danny
    Member

    Just as @sanjoy has said, I have changed around with the order of points to render and this hopefully solved your issue.

    http://jsfiddle.net/9h9ny0b6/2/

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

You must be logged in to reply to this topic.