I've started experimenting with Highstock charts to visualize my photovoltaics data. The problem is, that the chart starts with 01-01-1970 00:00:00. It ignores the date and time in my csv-file.
This code is the same as some examples here, but it doesn't work.
My data.csv
2011-08-01 00:00:00,155
2011-08-02 00:00:00,156
2011-08-03 00:00:00,157
2011-08-03 00:06:00,160
2011-08-04 00:00:00,120
My index.html
$(document).ready(function() {
var c = [];
var d = [];
var options = {
chart: {
renderTo: 'content',
defaultSeriesType: 'line'
},
xAxis: {
title: {
text: 'Datum'
},
type: 'datetime',
categories: c
},
yAxis: {
title: {
text: 'Stromertrag [wH]'
}
},
series: [{
data: d,
}]
};
var jqxhr = $.get('../data/data.csv', function(data) {
var lines = data.split('\n');
$.each(lines, function(lineNo, line) {
var items = line.split(',');
c.push(items[0]);
d.push(parseInt(items[1]));
})
var chart = new Highcharts.StockChart(options);
});
});