Home Forums Chart Support Set XAxis Value to start at 0 Reply To: Set XAxis Value to start at 0

#16102

@vishnumohan89,

To design a line chart that always starts from y-axis line you can set the minimum of axisX to the x-value of the first dataPoint. Please check the below code snippet –

function setAxisXMinimum(){
   chart.axisX[0].set("minimum", chart.options.data[0].dataPoints[0].x);
}

Also, kindly take a look at this JSFiddle for complete working code.

setting minimum of x-axis

___________
Indranil Deo
Team CanvasJS