@siradelaide,
You can parse the JSON data from your server and render it to the chart. Please check the code snippet below:
function parseJSON(jsonData) {
var dataPoints = [];
for(var i=0; i<jsonData.length; i++){
var label = jsonData[i].SensorName;
var yValue = parseFloat(jsonData[i].SensorValue);
dataPoints.push({label: label, y: yValue})
}
chart.options.data[0].dataPoints = dataPoints;
chart.render();
}
Please take a look at this JSFiddle for an example on the same.
—
Sachin Bisht
Team CanvasJS