I have an X-axis representing time intervals in 15-second increments.
["2020-05-22 14:20:22", "173.9"]
["2020-05-22 14:20:40", "175.3"]
["2020-05-22 14:20:58", "172.4"]
In my attempt to add this data to the chart, I used the following code:
for(var key in json)
{
var xTime = stringToDate(json[key][0]);
var yVal = parseFloat(json[key][1]);
series.add({ x: timer, y: yVal})
}
function stringToDate(s) {
s = s.split(/[-: ]/);
return new Date(s[0], s[1]-1, s[2], s[3], s[4], s[5]);
}
However, the resulting chart displayed strange values on the x-axis.