".$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