In this example, we create a simple KitBox using a JavaScript array as a data source. We have turned the data table and overview off to show the graph in it's simplest form.
<script> $("#kitbox").kitbox({ kitboxType: "kitboxSeries", dataType: "json", url: "/pages/series/remote_json.php", header: {text: "Ajax JSON"} }); </script>
<?php $data = array( "data" => array(), "xaxis" => array()); $number = 30; for( $x = 0; $x < $number / 5; $x++ ){ $slice = array(); for( $y = 0; $y < $number; $y++ ) array_push( $slice, mt_rand( mt_rand(1,49) * ($x + 1), mt_rand(50,100) * ($x + 1) ) ); array_push($data['data'], array( "data" => $slice, "label" => "Series: " . $x)); } for( $x = 0; $x < $number; $x++ ) array_push($data['xaxis'], "Element: " . $x ); echo json_encode( $data ); ?>