Highcharts format -
I am trying to do the work of the format for the hierarchies.
In a demo, there is the following call:
$ .getJSON ('http://www.highcharts.com/samples/data/jsonp.php?filename = Range.json & amp; callback =? ', Function (data) {code to make charts When the call is made, the data similar to the following is returned:
callback ([ / * 2009-01-01 * / [1230771600000, -5.8, 0.1], [1230858000000, -4.1, 1.4], [1230 9 44400000, -0.5, 4.1], [1231030800000, -8.9, -0.7], [1231117200000, -9.7, -3.7], [1231203600000, -3.4, 3.2], [1231290000000, -3.9, -0.2], [1231376400000 , -2.4, 6.7], [1231462800000, 3.8, 6.9], [1231549200000, 3.1, 6.8]];
The problem I am having is that I call my own AJAX I want to distribute the data through the medium, as a result, despite the graph data and some other things, I do not think the format is correct, so HC can read it, but there is no luck about the I formats. < P> I think the problem 'callback ([]);' The container needs to be removed, but when I do this, the data is not displayed on the chart.
li
I went to the same problem once Before accepting an array in this format, your Jason has to be parsed
<[ While your quoted Jason,
[[string, string], [string, string] after removing your callback ([]); ' Container, you need to parse the individual '[x, y]' number before supplying for series item. One way to do
(in JS):
- string [] jsonComponents = jsonWithoutContainer.split (",");
- Pause each jsonComponents array.
- For each jsonComponent - string [] xyComps = jsonComponent.split (",");
- X = PersFlot (XIcomp [0]); Y1 = parseFloat (xyComp [1]); Y2 = parseFloat (xyXomp [2]);
- Put in array, use array1.push (x, y1) and supply this chart for series (array1)
Comments
Post a Comment