".$goalFile.""); } function renderChart($height, $chartValues, $chartLabels, $title){ $pad = "       "; //////////////////////////////////////////////// // // Print Title // //////////////////////////////////////////////// //print (""); //print ("$pad$title

\n"); //print ("
"); //////////////////////////////////////////////// // // Determine Vertical Scale // //////////////////////////////////////////////// $maxValue = 0; for ($n=0; $n $maxValue) $maxValue = $chartValues[$n]; } //$maxValue = ceil($maxValue/100) * 100; $valuePerRow = floor($maxValue/$height); //////////////////////////////////////////////// // // Print Graph // //////////////////////////////////////////////// for ($row = 0; $row < $height; $row++){ $number = sprintf("%'.5d |", $maxValue - ($row*$valuePerRow)); $number = preg_replace("/\./"," ",$number); print (""); print ($number); print (""); print (""); for($col = 0; $col < count($chartValues); $col ++){ if ($chartValues[$col] > $maxValue - ($row*$valuePerRow)) { print ("* "); }else{ print ("  "); } } print ("
\n"); print ("
"); } //////////////////////////////////////////////// // // Print Vert Divider // //////////////////////////////////////////////// print (""); print ($pad); for($col = 0; $col < count($chartValues); $col ++){ print("--"); } print ( "   " ); //this pad is just to put some marign on the right side in the div. print ("
\n"); print ("
"); //////////////////////////////////////////////// // // Print Labels // //////////////////////////////////////////////// print (""); for ($row = 0; $row < 11; $row++){ print ($pad); //for ($n = 0; $n < $row; $n++){ // print(" "); //} for($col = 0; $col < count($chartLabels); $col ++){ if (substr ($chartLabels[$col], $row , 1) == "/"){ print(" "); }else{ print(substr ($chartLabels[$col], $row , 1)); } print(" "); } print ("
\n"); } print ("
"); } ?> Volcano Kit Log Plotter
ASCII Log Plotter:
 
This script will look through an apache log file and count how many times a user specified file is accessed each day. The results are returned as a ascii graph. Days without hits are omitted from the graph.

Track the popularity of these parts of Volcano Kit:

  VK2 Main Page

  the beepmaker

  VK iTunes Visualizer

  5x5 Screen Saver

  Treads of Fury (MI)



Or enter another page:




Feel free to use this code any way you wish.




view source
 
Hits Per Day: