diff -r 1d6e762433fe -r 0acb8d9a3194 htdocs/24hours.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/htdocs/24hours.php Mon Aug 25 12:34:26 2008 -0400 @@ -0,0 +1,60 @@ += 0; $i-- ) +{ + $basetime = $this_hour - ( $i * 3600 ); + $ts = date('H:i', $basetime); + $basetime += 3600; + $graphdata[$ts] = stats_message_count($channel, 60, $basetime); +} + +$max = max($graphdata); + +// Determine axis interval +$interval = 2; +if ( $max > 20 ) + $interval = 4; +if ( $max > 25 ) + $interval = 5; +if ( $max > 50 ) + $interval = 10; +if ( $max > 200 ) + $interval = 40; +if ( $max > 500 ) + $interval = 80; +if ( $max > 1000 ) + $interval = 100; +if ( $max > 2000 ) + $interval = 200; +if ( $max > 5000 ) + $interval = 1000; +if ( $max > 15000 ) + $interval = 1500; +if ( $max > 30000 ) + $interval = round($max / 10); + +$g = new GraphMaker(); // _Compat(); + +$g->SetGraphPadding(20, 30, 20, 15); +$g->SetGraphAreaHeight(200); +$g->SetBarPadding(10); +$g->SetBarData($graphdata); +$g->SetGraphBackgroundTransparent(240, 250, 255, 0); +$g->SetGraphTransparency(25); +$g->SetAxisStep($interval); +$g->SetGraphTitle($channel . ' message count - last 24 hours'); + +$g->DrawGraph();