I want to add some series (I get the series data from the webservice as a 3dim array (and return it as json) - I do not know the number of series that I will get, so I have to load the series data dynamically).
In javascript, I create an object: (for example, this high-level example: http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/stock/demo / compare / )
seriesOptions[i] = { name: namearray[i], data: dataarray }; eg result: [Object { name="Series", data=[[1041375600000, 29,9]]}]
I tried to add a series as follows:
$.each(seriesOptions, function (itemNo, item) { chart.addSeries({ name: item.name, data: item.data }, false); }); chart.redraw();
But the diagram draws a series of the genus weird and does not convert to a timestamp today. Are there any problems with my chart data from webservice?
Here is my code: http://jsfiddle.net/DGdaf/2/
Thanks for any help.
EDIT
The chart seems to ignore all the default values โโfor the timeline / scaling value. I have no idea why it does not display these components.
The problem may be that I am drawing a chart after initialization?
chart = new Highcharts.Chart(options);
But I have to do this to load the dynamic series.
EDIT2
I'm not sure if I upload too much data or something like that. I cannot create my series dynamically.
for(i=0; i<seriesOptions.length; i++){ chart.addSeries({ name: seriesOptions[i].name, data: seriesOptions[i].data }, true); };