$color2 = 'white';
$color3 = 'white';
$color4 = 'black';
- if ($percent>1) {
+ /* if ($percent>1) {
$percent = $percent/100;
- } /*
+ }
} elseif (!is_integer($percent) && $percent<2) {
$percent = $percent*100;
} elseif ($percent == 1) {
$percent = 100;
} */
- $per1 = $per2 = ceil($percent*100);
- $per2 = 100 - $per2;
+ $per1 = $per2 = floor($percent*100);
+ if ($per1>100) {
+ $per1 = 100;
+ $per2 = 0;
+ } else {
+ $per2 = 100 - $per2;
+ }
$per1 .= "%";
$per2 .= "%";
- return '<table cellpadding=0 cellspacing=0 width="100%" class="bargraph">
+/* return '<table cellpadding=0 cellspacing=0 width="100%" class="bargraph">
<tr>
<td class="bar" align="left" width="'.$per1.'"><div style="position: relative;"><div style="left: 0; display: inline; position: absolute;"> '.$txt1.' </div> </div></td>
- <td class="fill" width="'.$per2.'"><div style="position: relative;"> <div style="right: 0; display: inline; position: absolute;">'.$txt2.' <em>'.$per1.'</em></div></div></td>
- </tr></table>';
+ <td class="fill" align="left" width="'.$per2.'"><div style="position: relative;"> <div style="right: 0; display: inline; position: absolute;">'.$txt2.' <em>'.$per1.'</em></div></div></td>
+ </tr></table>';*/
+ return '<table cellpadding=0 cellspacing=0 width="100%" class="bargraph">
+ <tr>
+ <td class="bar" align="left" width="'.$per1.'"><div style="position: relative;"></div></td>
+ <td class="fill" align="right" width="'.$per2.'"><div style="position: relative;"></div></td>
+ </tr>
+ </table><table cellpadding=0 cellspacing=0 width="100%">
+ <tr style="height: 1px;">
+ <td class="bar" align="left" width="50%"><div style="position: relative;"><div style="bottom: 3px; left: 5px; position: absolute;">'.$txt1.'</div></div></td>
+ <td class="fill" align="right" width="50%"><div style="position: relative;"><div style="bottom: 3px; right: 3px; position: absolute;">'.$txt2.' <em>'.$per1.'</em></div></div></td>
+ </tr>
+ </table>';
}
?>