I have the following: http://jsfiddle.net/Ve5ZQ/6/
I am attempting to reference the x value in the [x,y] pairs within chartGPS.series[0].data to determine the largest value of x currently in the series. However, it appears that I am referencing an undefined value for comparison.
'data' appears to be an array of arrays, so iterating through its pairs should be allowed with:
var lastUpdate = 0;
var theSeries = chartGPS.series[0].data;
// Loop to determine last updated timestamp (x value)
for (var i in theSeries) {
// I think theSeries[i][0] should be the x value for each pair
alert(theSeries[i]); // Always alerts "undefined"
if (theSeries[i][0] > lastUpdate) {
lastUpdate = theSeries[i][0];
}
}
What am I doing wrong?