Home Forums Report Bugs When using Date object as X data label differs with one month

When using Date object as X data label differs with one month

Viewing 7 posts - 1 through 7 (of 7 total)
  • #8217

    I’ve just recently started to play around with canvasjs, so I might have missed something, but I came across an oddity which may be a bug.

    See: https://jsfiddle.net/e2o36mf0/

    If you zoom into the chart (preferrably at the very start) and compare the Y-values in the script and the chart you’ll notice that the x-axis is exactly one month ahead in the chart compared to the datapoint.
    I’m sorry for posting so many datapoints, I just wanted the example to contain the data I’m working with to make the test more realistic.
    I’d appreciate if you would let me know if this is a bug or something else.
    Thanks also for a very interesting piece of software.
    Very best
    Jon Brunberg

    #8236

    Hi,

    The JSFiddle that you have provided is blank. Looks like u forgot to save the fiddle. Can you please updated the same so that we can have a look.


    Sunil Urs

    #8243

    Oops! Sorry.
    I had to fork out your original fiddle again. Here’s a link to the new one:
    http://jsfiddle.net/brunberg/6g9w1xo2/1/

    I’ve used a handful of points this time.
    /jon

    #8244

    Well, I think I may have found a solution

    http://jsfiddle.net/brunberg/nnmepfkq/1/

    For some reason I output the dates in descending order in the first example. When changing the sort order to ascending everything is fine!

    /jon

    #9030

    I have same problem,

    I’m using canvasjs charts on lots of my sites, but just noticed today that all of them is one month ahead somehow,

    I just checked the data the chart was getting, and the time is correct.

        [3894] => Array
            (
                [totalweight] => 13842951
                [time] => 2015, 05, 26, 15, 00
            )

    But the chart shows 2015, 06, 26, 15, 00

    I tried sorting it as per brunberg posts, but didn’t work.

    Any suggestions?

    • This reply was modified 8 years, 9 months ago by Convertor.
    #9034

    Anyone?

    #9042

    Hi,

    This is not a bug. JavaScript month index starts from 0. Hence month 0 (January) becomes 1 displaying. Please refer to this thread.


    Sunil Urs

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

You must be logged in to reply to this topic.