Index: /trunk/admin/common.php
===================================================================
--- /trunk/admin/common.php	(revision 418)
+++ /trunk/admin/common.php	(revision 517)
@@ -109,4 +109,7 @@
 	$lang = 'en-us';
 }
+if (!isset($free_graph_width)) {
+	$free_graph_width = 120;
+}
 
 ?>
Index: /trunk/admin/xcache.tpl.php
===================================================================
--- /trunk/admin/xcache.tpl.php	(revision 456)
+++ /trunk/admin/xcache.tpl.php	(revision 517)
@@ -51,4 +51,8 @@
 		$pused = 100 - $pavail;
 
+		$graph = freeblock_to_graph($ci['free_blocks'], $ci['size']);
+		$w = $free_graph_width;
+		$tdwidth = $w + 2;
+
 		$ci_slots = size($ci['slots']);
 		$ci_size  = size($ci['size']);
@@ -62,5 +66,11 @@
 		<td title="{$ci['size']}">{$ci_size}</td>
 		<td title="{$ci['avail']}">{$ci_avail}</td>
-		<td title="{$pavail} %"><div class="percent"><div style="height: {$pused}%" class="pused">&nbsp;</div><div style="height: {$pavail}%" class="pavail">&nbsp;</div></div></td>
+		<td title="{$pavail} %" width="{$tdwidth}"
+			><div class="percent" style="width: {$w}px"
+				><div style="width: {$pavail}%" class="pavail"></div
+				><div style="width: {$pused}%" class="pused"></div
+			></div
+			><div class="usagegraph" style="width: {$w}px">{$graph}</div
+		></td>
 		<td>
 			<form method="post">
@@ -89,30 +99,4 @@
 	<?php } ?>
 </table>
-<div>
-	<?php echo _T('Free Blocks'); ?>:
-</div>
-<?php
-foreach ($cacheinfos as $i => $ci) {
-	$b->reset();
-?>
-<table cellspacing="0" cellpadding="4" class="cycles freeblocks">
-	<tr>
-		<th><?php echo $ci['cache_name']; ?> <?php echo _T("size"); ?><br><?php echo _T("offset"); ?></th>
-	<?php
-	foreach ($ci['free_blocks'] as $block) {
-		$size   = size($block['size']);
-		$offset = size($block['offset']);
-
-		$c = $b->next();
-		echo "
-		<td $c><nobr>$size<br>$offset</nobr></td>";
-	}
-	?>
-
-	</tr>
-</table>
-<?php
-}
-?>
 <div style="clear: both">&nbsp;</div>
 <?php
Index: /trunk/admin/xcache.php
===================================================================
--- /trunk/admin/xcache.php	(revision 421)
+++ /trunk/admin/xcache.php	(revision 517)
@@ -73,4 +73,37 @@
 
 	return '0 s';
+}
+
+function freeblock_to_graph($freeblocks, $size)
+{
+	global $free_graph_width;
+
+	// cached in static variable
+	static $graph_initial;
+	if (!isset($graph_initial)) {
+		for ($i = 0; $i < $free_graph_width; $i ++) {
+			$graph_initial[$i] = 0;
+		}
+	}
+	$graph = $graph_initial;
+	foreach ($freeblocks as $b) {
+		$begin = $b['offset'] / $size * $free_graph_width;
+		$end = ($b['offset'] + $b['size']) / $size * $free_graph_width;
+
+		$graph[(int) $begin] += 1 - ($begin - (int) $begin);
+		$graph[(int) $end] += ($end - (int) $end);
+		for ($i = (int) $begin + 1, $e = (int) $end; $i < $e; $i ++) {
+			$graph[$i] = 1;
+		}
+	}
+	$html = array();
+	$c = 255;
+	foreach ($graph as $k => $v) {
+		$v = (int) ($v * $c);
+		$r = $g = $c - $v;
+		$b = $c;
+		$html[] = '<div style="background: rgb(' . "$r,$g,$b" . ')"></div>';
+	}
+	return implode('', $html);
 }
 
Index: /trunk/admin/xcache.css
===================================================================
--- /trunk/admin/xcache.css	(revision 371)
+++ /trunk/admin/xcache.css	(revision 517)
@@ -20,7 +20,13 @@
 .freeblocks td { text-align: right; }
 form {margin: 0; padding: 0}
-.percent { border: 1px solid black; width: 80%; height: 20px; }
-.percent div { font-size: 1px; line-height: 1px; width: 100%;}
-.percent .pavail { background: blue; }
+
+.percent { height: 3px; margin-bottom: 1px; background: gray; border: 1px solid gray; border-top: 0px; border-bottom: 0px; }
+.percent div { float: left; height: 100%; }
+.percent .pavail { background: green; }
+
+.usagegraph { height: 16px; }
+.usagegraph div { float: left; height: 3px; width: 4px; border: solid gray; border-width: 0 0px 1px 0; }
+.usagegraph { border: 1px solid gray; border-bottom: 0px; }
+
 .switcher, h1, h2 { text-align: center; display: block; }
 .switcher * { color: blue; }
Index: /trunk/admin/config.php.example
===================================================================
--- /trunk/admin/config.php.example	(revision 161)
+++ /trunk/admin/config.php.example	(revision 517)
@@ -11,4 +11,7 @@
 // developers only
 $show_todo_strings = false;
+
+// width of graph for free blocks
+$free_graph_width = 120;
 
 // this function is detected by xcache.tpl.php, and enabled if function_exists
