Home Forums Chart Support Simple chart and XMLHttpRequest query Reply To: Simple chart and XMLHttpRequest query


OK so I can get the chart to plot if I use static data like this:
var dataPoints = [{y : 10}, {y : 13}, {y : 18}, {y : 20}, {y : 17}];

The live data that I want to plot looks like this (note this is taken directly from console.log user message:
{x: 12, y: 3.65}, {x: 16, y: 2.55}, {x: 17, y: 3.70}, {x: 17, y: 2.50}

However in debug mode, Chrome is putting quotation marks around it:
eg “{x: 32, y: 1.90}”

So my next question is, what is wrong with the following code that it has a problem with?

The actual error I get in the lower error console is:
Uncaught TypeError: Cannot use ‘in’ operator to search for ‘name’ in {x: 53, y: 2.05}, {x: 53, y: 2.35}, {x: 54, y: 3.75}
at H.V.setOptions (canvasjs.min.js:100)
at H.V (canvasjs.min.js:32)
at new H (canvasjs.min.js:138)
at m._initialize (canvasjs.min.js:171)
at m.render (canvasjs.min.js:202)
at UpdateGraph ((index):1)