Menu

JSON data

JASON KLEINBUB

The application expects the data to appear in the following format.


{"labels":
[
{"lbl": {"data1":"abc","data2":"efg", ... "dataN":"xyz"},"count":1}
{"lbl": {"data1":"abc","data2":"efg", ... "dataN":"xyz"},"count":1}
{"lbl": {"data1":"abc","data2":"efg", ... "dataN":"xyz"},"count":1}
...
{"lbl": {"data1":"abc","data2":"efg", ... "dataN":"xyz"},"count":1}
],
"Remaining":0}

in php I use the following.

$output['labels'][] = array(
'lbl'=> array('data1'=> $a1, 'data2'=>$b1, 'data3'=>$c1),
'count'=>1
);
$output['labels'][] = array(
'lbl'=> array('data1'=> $a2, 'data2'=>$b2, 'data3'=>$c2),
'count'=>1
);
$output['Remaining'] = 0;
echo json_encode($output);

This data can either come via http as per the configuration, or in a file.


Related

Wiki: Configuration
Wiki: Home