#!/usr/bin/php4 $end_time) break; $barheight = round ($hits[$graph_date] * (200 / $barscale)); imagefilledrectangle ($graph_image, round ($i * $barwidth), (204 - $barheight), (round (($i + 1) * $barwidth) -1), 204, $graph_color); if ($time_range <= 12) { imageline ($graph_image, ($i * $barwidth), 4, ($i * $barwidth), 204, IMG_COLOR_STYLED); $graph_date_formated = date ("m/d", $current_time); imagestring ($graph_image, 1, (round (($i * $barwidth) + ($barwidth / 2)) - 12), 210, "$graph_date_formated", $text_color); } elseif ($date_range <= 62) { if (date ("D", $current_time) == "Sun") { imageline ($graph_image, ($i * $barwidth), 4, ($i * $barwidth), 204, IMG_COLOR_STYLED); $graph_date_formated = date ("m/d", $current_time); imagestring ($graph_image, 1, round ($i * $barwidth), 210, "$graph_date_formated", $text_color); } } $i++; } //Annotate the graph $i = 0; while ($i <= 10) { imageline ($graph_image, 0, 4, 0, 204, IMG_COLOR_STYLED); imageline ($graph_image, 365, 4, 365, 204, IMG_COLOR_STYLED); imageline ($graph_image, 0, (($i * 20)+4), 365, (($i * 20)+4), IMG_COLOR_STYLED); imagestring ($graph_image, 1, 370, ($i * 20), ($barscale - ($i * ($barscale / 10))), $text_color); $i++; } //Output the graph header("Content-type: image/png"); imagepng ($graph_image); imagedestroy ($graph_image); ?>