Home forums Using CanvasJS Data Time Chart — No Values for dates

This topic contains 1 reply, has 2 voices, and was last updated by  Vishwas R 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #24947

    HI

    I want a Simple Date Area chart to set the x axis to 0 if no dataset is present for that particular date

    e.g.
    In the below there is no value for date 3rd Jan so for this date the x axis should set to zero which in my case is not setting.
    data: [
    {
    type: “area”,
    dataPoints: [//array
    { x: new Date(2012, 01, 1), y: 26},
    { x: new Date(2012, 01, 2), y: 43},
    { x: new Date(2012, 01, 4), y: 54}
    ]
    }
    ]
    });

    Date & Time Axis

    #24956

    @abdul8423,

    CanvasJS library just renders chart with dataPoints provided by you and it don’t modify the dataPoints that you have passed. To add missing dates, you can parse through dataPoints array and add missing dates to it before rendering the chart as shown in this JSFiddle.


    Vishwas R
    Team CanvasJS

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

You must be logged in to reply to this topic.