[ { dateTime: '2016-03-30 05:55:53', value: '4.0' },
{ dateTime: '2016-03-30 05:55:55', value: '17.0' },
{ dateTime: '2016-03-30 05:55:57', value: '17.0' },
{ dateTime: '2016-03-30 06:00:51', value: '33.0' } ]
the provided values are stored in the console.log(points.points[tags[0]]) variable, however attempting to access a specific item like console.log(points.points[tags[0]][0]) throws an error as follows: { dateTime: '2016-03-30 06:00:51', value: '33.0' }
when trying to print the individual data elements such as console.log(points.points[tags[0]][0].dateTime), an error occurs with the messages "Cannot read property 'dateTime' of undefined" and "Cannot read property 'value' of undefined".
var data = [];
<%
for (var i=0; i < tags.length; i++)
{ %>
var dataSeries = { type: "line" };
var dataPoints = [];
// var pointdata ="<%= points.points[tags[i]] %>";
for (var n=0; n < <%= points.points[tags[i]].length %>; n++)
{
<%= console.log(points.points[tags[i]]); %>
dataPoints.push({
x: <%= points.points[tags[i]][n].dateTime %>,
y: <%= points.points[tags[i]][n].value %>
});
}
dataSeries.dataPoints = dataPoints;
data.push(dataSeries);
<% } %>
</script>