Home › Forums › Chart Support › How to handle NaN data points › Reply To: How to handle NaN data points
@mnair,
y value in datapoint object only accepts numeric value as of now. We suggest you to replace NaN value with null or 0 as shown in the code snippet below:
for(var i = 0; i < chart.options.data[0].dataPoints.length; i++){ if(isNaN(chart.options.data[0].dataPoints[i].y)){ chart.options.data[0].dataPoints[i].y = null; } }
__ Sachin Bisht Team CanvasJS