Código PHP:
Ver original<html>
<head>
<style type="text/css">
.Barra {
Padding:10px;
Display:Table;
Box-Shadow: 0 0 3px #666;
border-radius:0 5px 5px 0 ;
}
</style>
</head>
<?php
$query_total = "SELECT medio as NombreMedio, count(medio) as TotalMedio From mediosc GROUP BY medio ";
$I=0;
$Grafico[$I]['Titulo'] = $row['NombreMedio'];
$Grafico[$I]['Valor'] = $row['TotalMedio'];
$Grafico[$I]['Color'] = '#BDDA4C';
$I++;
}
$Max = 0;
ForEach ( $Grafico As $Datos ) { $Max += $Datos['Valor']; }
?>
<body>
<table width="600" cellspacing="0" cellpadding="2">
<?php
ForEach( $Grafico As $Datos ) {
$POR = Round((( $Datos['Valor'] / $Max ) * 100),2); Echo <<<HTML
<tr>
<td width="20%">
<strong>$Datos[Titulo]:</strong> $Datos[Valor]
</td>
<td>
<Div Style="width:$POR%;background:$Datos[Color];" Class="Barra"> </Div>$POR%
</td>
</tr>
HTML;
}
?>
</table>
</body>
</html>