You must be logged in to post your query.
Home › Forums › Chart Support › Data Time Chart — No Values for dates
Tagged: area chart, chat with no dataset
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} ] } ] });
https://canvasjs.com/docs/charts/basics-of-creating-html5-chart/date-time-axis/
@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
You must be logged in to reply to this topic. Login/Register