Home Forums Report Bugs Axis X with empty dataPoints

Axis X with empty dataPoints

Viewing 5 posts - 1 through 5 (of 5 total)
  • #11700

    Luc

    Dear canvasjs support,

    I try to set the X axis with an empty graph. But when I put this, nothing is displaying on axis X:

    axisX: {
    minimum: new Date(2016,8,4),
    maximum: new Date(),
    },

    it’s seems there is a problem with date object because if I put in place number values it works fine:

    axisX: {
    minimum: 0,
    maximum: 24,
    },
    data: [
    {
    dataPoints: [],
    }

    Thank you for the help

    #11701

    Hi,

    In JavaScript date-time object format of new Date(year, month[, day[, hour[, minutes[, seconds[, milliseconds]]]]]); 2nd(month) parameter starts from 0 (ie. 0 maps to January). [Source]

    Similarly in your case 8 will represent to September, which will be more than assigned maximum of new Date(). That’s why you won’t get any labels in axis X.

    #11704

    Luc

    Hi Sanjoy,

    Thank you for the answer, but unfortunately it is not my issue…
    Please have a look on this: http://jsfiddle.net/wkgqsw8c/

    regards,

    #11713

    Thank you for reporting the issue, we will resolve it and will get back to you soon.

    #11728

    Luc

    Hi,
    Thank you for the support.
    In fact I found a trick, I add a virtual point in the dataPoints in a past time which has nothing related to my chart. Like that it works as I want. http://jsfiddle.net/x1tr0kkv/1/

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

You must be logged in to reply to this topic.