Home Forums Chart Support array Reply To: array



The dataPoints must be parsed in a format accepted by CanvasJS. You can parse the dataPoints from an array and render the chart as shown in the code-snippet below,

function parseDataPoints () {
  for (var i = 0; i <= dataArray.length; i++)
    dps.push({y: dataArray[i]});     

chart.options.data[0].dataPoints = dps;

Kindly take a look at this JSFiddle for an example on parsing dataPoints from array and rendering the chart.

Adithya Menon
Team CanvasJS