I have searched and searched but i'm unable to find the solution yet.
I'm trying to load data into Highcharts with json from my server. This is the json returned from my server:
[{
"x": "\/Date(1352674800000)\/",
"y": 621
}, {
"x": "\/Date(1352761200000)\/",
"y": 646
}, {
"x": "\/Date(1352847600000)\/",
"y": 690
}, {
"x": "\/Date(1352934000000)\/",
"y": 688
}, {
"x": "\/Date(1353020400000)\/",
"y": 499
}]
this is my highchart: (from my jsfiddle)
var seriesData = [];
for (var i = 0; i < data.length; i++) {
var dateString = data[i].x;
var x = dateString.replace(/\/Date\((\d+)\)\//, '$1');
var y = data[i].y;
seriesData.push([x, y]);
}
alert(seriesData);
var options = {
chart: {
renderTo: 'container'
},
xAxis: {
type: 'datetime',
labels: {
formatter: function() {
var monthStr = Highcharts.dateFormat('%a', this.value);
var firstLetter = monthStr.substring(0, 1);
return firstLetter;
}
}
},
series: []
};
function myfunk() {
options.series.push(seriesData);
chart = new Highcharts.Chart(options);
}
myfunk();
but my data is not showing.
i made a jsfiddel: http://jsfiddle.net/grVFk/12105/
Edit:
Now it's working but is the data point showing the wrong dates? http://jsfiddle.net/dxCHB/18/
If someone could help me i would be very grateful ! :)