twilly
Posts: 3
Joined: Mon Feb 17, 2014 3:58 pm

What format does Json data need to be in

I am trying to use json data in the editor, how do I format data so that I can use the editor?

Currently using the following


[[4.000000000000000],[23.000000000000000],[2.000000000000000],[30.000000000000000],[60.000000000000000],[70.000000000000000],[9.000000000000000],[4.000000000000000],[7.000000000000000],[3.000000000000000],[360.000000000000000],[60.000000000000000],[200.000000000000000],[50.000000000000000],[2.000000000000000],[2.000000000000000],[1.000000000000000],[2.000000000000000],[1.000000000000000],[3.000000000000000],[2.000000000000000],[2.000000000000000],[2.000000000000000],[4.000000000000000],[2.000000000000000],[5.000000000000000],[1.000000000000000],[2.000000000000000],[26.000000000000000],[2.000000000000000],[2.000000000000000],[1.000000000000000],[2.000000000000000],[1.000000000000000],[1.000000000000000],[4.000000000000000],[4.000000000000000],[4.000000000000000],[2.000000000000000],[2.000000000000000],[8.000000000000000],[447.000000000000000],[1889.000000000000000],[1.000000000000000],[38.000000000000000],[32.000000000000000],[328.000000000000000],[90.000000000000000],[50.000000000000000],[100.000000000000000],[50.000000000000000],[50.000000000000000],[5.000000000000000],[60.000000000000000],[50.000000000000000],[2.000000000000000],[2.000000000000000],[4.000000000000000],[4.000000000000000],[4.000000000000000],[12.000000000000000],[1.000000000000000],[1.000000000000000],[1.000000000000000],[4.000000000000000],[1.000000000000000],[2.000000000000000],[110.000000000000000],[24.000000000000000],[1.000000000000000],[1.000000000000000],[2.000000000000000],[15.000000000000000],[2.000000000000000],[60.000000000000000],[60.000000000000000],[60.000000000000000],[2.000000000000000],[2.000000000000000],[160.000000000000000],[160.000000000000000],[160.000000000000000],[160.000000000000000],[160.000000000000000],[36.000000000000000],[9.000000000000000],[2.000000000000000],[2.000000000000000],[2.000000000000000],[2.000000000000000],[40.000000000000000],[40.000000000000000],[40.000000000000000],[2.000000000000000],[2.000000000000000],[2.000000000000000],[100.000000000000000],[50.000000000000000],[1.000000000000000],[12.000000000000000],[40.000000000000000]]
cpopolo
Posts: 28
Joined: Thu Feb 08, 2018 7:01 pm

Re: What format does Json data need to be in

Assuming JavaScript, you already have a JavaScript array. Here are some transforms that might be helpful:

a = [[4.000000000000000],[23.000000000000000],[2.000000000000000]] // A short version of your array

b = JSON.stringify(a)
returns: "[[4],[23],[2]]"

c = JSON.parse(b)
returns a JSON representation of your array:
(3) [Array(1), Array(1), Array(1)]

Not sure if this answers your question, but the Firebug console is a great place to experiment with transformations and inspections of your data.

Return to “Highslide Editor”