Index: trunk/htdocs/cacher/cacher.php
===================================================================
--- trunk/htdocs/cacher/cacher.php	(revision 1053)
+++ trunk/htdocs/cacher/cacher.php	(revision 1058)
@@ -92,18 +92,18 @@
 }
 
-function hits_to_graph($hits)
-{
-	$max = 0;
-	foreach ($hits as $v) {
-		if ($max < $v) {
-			$max = $v;
-		}
+function get_cache_hits_graph($ci, $key)
+{
+	if ($ci['cacheid'] == -1) {
+		$max = max($ci[$key]);
+	}
+	else {
+		$max = $GLOBALS['maxhits_by_hour'][$ci['type']];
 	}
 	if (!$max) {
-		return '';
+		$max = 1;
 	}
 	$t = (time() / (60 * 60)) % 24;
 	$html = array();
-	foreach ($hits as $i => $v) {
+	foreach ($ci[$key] as $i => $v) {
 		$html[] = bar_hits_percent($v, $v / $max, $i == $t);
 	}
@@ -185,4 +185,5 @@
 $cacheinfos = array();
 $total = array();
+$maxhits_by_hour = array(0, 0);
 for ($i = 0; $i < $pcnt; $i ++) {
 	$data = xcache_info(XC_TYPE_PHP, $i);
@@ -194,4 +195,5 @@
 	$data['cacheid'] = $i;
 	$cacheinfos[] = $data;
+	$maxhits_by_hour[XC_TYPE_PHP] = max($maxhits_by_hour[XC_TYPE_PHP], max($data['hits_by_hour']));
 	if ($pcnt >= 2) {
 		calc_total($total, $data);
@@ -218,4 +220,5 @@
 	$data['cacheid'] = $i;
 	$cacheinfos[] = $data;
+	$maxhits_by_hour[XC_TYPE_VAR] = max($maxhits_by_hour[XC_TYPE_VAR], max($data['hits_by_hour']));
 	if ($vcnt >= 2) {
 		calc_total($total, $data);
