- Impact
- 64
This may be simple but it took me a while to figure out, you will need a 1x1 png image for your graph's background
PHP:
//Sample Graph
$graph[0] = 5;
$graph[1] = 8;
$graph[2] = 1;
$graph[3] = 52;
//How much to scale the graph up (use a decimal to scale down)
$scale = 2;
//Code Starts Here
echo '<span style="font-family:\'Courier New\', Courier;">';
$i=1;
foreach($graph as $point){
$point = $point * $scale;
if($i < count($graph)){
echo '<img style="border-top:1px solid #000000;border-left:1px solid #000000;border-bottom:1px solid #000000;" src="graph.png" height="'.$point.'" width="40px"/>';
}else{
echo '<img style="border:1px solid #000000;" src="graph.png" height="'.$point.'" width="40px"/>';
}
}
echo '<br/>';
foreach($graph as $point){
if($point <= 9){
echo $point.' ';
}elseif($point <= 99){
echo $day['income'].' ';
}elseif($day['income'] <= 999){
echo $day['income'].' ';
}
}
echo '</span>';




