tu mas zakladny princip, neviem, ako presne to chces mat, takze dokoncenie necham uz na teba, uprav si to podla potreby (testovane na subore test.php):
Kód:
<?php
session_start();
$all_data = array(12124, 5535, 43373, 22223, 90432, 23332, 15544, 24523, 32778, 38878, 28787, 33243, 34832, 32302);
if(!isset($_SESSION['data'])) {
$_SESSION['data'] = array_fill(0, count($all_data), 0);
$_SESSION['data_index'] = 0;
} else {
$_SESSION['data_index']++;
}
if(count($all_data) >= $_SESSION['data_index']+2) {
header("Refresh:5; url=test.php");
}
$_SESSION['data'][$_SESSION['data_index']] = $all_data[$_SESSION['data_index']];
include('phpgraphlib.php');
$graph = new PHPGraphLib(500,350);
$graph->addData($_SESSION['data']);
$graph->setTitle('Widgets Produced');
$graph->setGradient('red', 'maroon');
$graph->createGraph();
?>