Real-Time Updates - Description

Live Example

Initialization Code

			<script>
			
				$("#kitbox").kitbox({
					kitboxType: "kitboxSeries",
					dataType: "json",
					url: "/pages/series/realtime.php",
					header: {text: "Real-Time Updates"},
					options: {
						seriesType: "realtime",
						interval: 3000,
						window: 20
					}
				});
				
			</script>
		

PHP Random Data Series Generator

			<?php
			
				$data = array( "data" => array(), "xaxis" => array());
				$number = 300;
				
				for( $x = 0; $x < 1; $x++ ){
					$slice = array();
						
					for( $y = 0; $y < $number; $y++ )
						array_push( $slice, mt_rand( ($y+1)*10, ($y+1)*200));
					
					array_push($data['data'], array( "data" => $slice, "label" => "Series: " . $x, "lines" => array("show" => false)));
				}
				
				for( $x = 0; $x < $number; $x++ )
					array_push($data['xaxis'],  "Element: " . $x );
				
				echo json_encode( $data );
				
			?>