<?php
$m = [];
for ($i = 0; $i < 1000; $i++)
{
$rnd = (int) (10 * log(rand(3, 50)));
$m[$rnd] = isset($m[$rnd]) ? $m[$rnd] + 1 : 0;
}
ksort($m);
foreach ($m as $i => $cnt)
echo "<div style='margin: 2px; color: #fff; padding: 3px; background: #696; width: ".($cnt * 10)."px;'>$i</div>\n";
?>