You must be logged in to post your query.
Home › Forums › Chart Support › Parse json with Index
Hi,
how to parse json with parent index element and multi series. Every “temp*” should render a single chart, so i need to assign the parents index separate data series.
{ “Temp1”: [ { “time”: 1576144810, “value”: 159 }, { “time”: 1576144810, “value”: 194 }, { “time”: 1576144810, “value”: 169 }, { “time”: 1576144810, “value”: 182 }, { “time”: 1576144810, “value”: 198 }, { “time”: 1576144810, “value”: 156 } ], “Temp2”: [ { “time”: 1576144810, “value”: 168 }, { “time”: 1576144810, “value”: 170 }, { “time”: 1576144810, “value”: 162 }, { “time”: 1576144810, “value”: 184 }, { “time”: 1576144810, “value”: 175 }, { “time”: 1576144810, “value”: 167 } ], “Temp3”: [ { “time”: 1576144810, “value”: 171 }, { “time”: 1576144810, “value”: 162 }, { “time”: 1576144810, “value”: 154 }, { “time”: 1576144810, “value”: 189 }, { “time”: 1576144810, “value”: 166 }, { “time”: 1576144810, “value”: 183 } ] }
@mwick,
Looping through the JSON and parsing it to the format accepted by CanvasJS before passing to the chart options should work fine in your case. Please take a look at this JSFiddle.
—- Manoj Mohan Team CanvasJS
You must be logged in to reply to this topic. Login/Register