vedi se questo ti è utile (togli i riferimenti ai css pero')
codice:
function makePercentageBar($w3,$v,$w,$h,$horizontal = true,$alt = '')
{
// Draw a percentage bar $w x $h and $v percentage
if($alt) $alt = "alt=\"$alt\" title=\"$alt\"";
if($horizontal)
{
$left_w = round(($v*$w/100));
$right_w = $w - $left_w;
$str = "<img class=\"percentageBarLeft\" src=\"".WM3_cSKIN_PATH."/percentage_bar_left.png\" align=\"middle\" width=\"$left_w\" height=\"$h\" $alt><img class=\"percentageBarRight\" src=\"".WM3_cSKIN_PATH."/percentage_bar_right.png\" align=\"middle\" width=\"$right_w\" height=\"$h\" $alt>";
}
else
{
$bottom_h = round(($v*$h/100));
$top_h = $h - $bottom_h;
$str = "<img class=\"percentageBarTop\" src=\"".WM3_cSKIN_PATH."/percentage_bar_top.png\" align=\"middle\" width=\"$w\" height=\"$top_h\" $alt>
<img class=\"percentageBarBottom\" src=\"".WM3_cSKIN_PATH."/percentage_bar_bottom.png\" align=\"middle\" width=\"$w\" height=\"$bottom_h\" $alt>";
}
return $str;
}