From 0003f8dd1e5ddb9a49c00e95bcc141247385647f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no> Date: Thu, 26 Feb 2009 14:27:46 +0000 Subject: [PATCH] Fix bug with axis labeling.. git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1333 44740490-163a-0410-bde0-09ae8108e29a --- modules/statistics/www/showstats.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/statistics/www/showstats.php b/modules/statistics/www/showstats.php index 0cc4c9096..a4fe44e13 100644 --- a/modules/statistics/www/showstats.php +++ b/modules/statistics/www/showstats.php @@ -153,8 +153,7 @@ $summaryDataset = array_reverse($summaryDataset, TRUE); $datasets = array(); -$axis = array(); -$axispos = array(); + #$max = 25; $availdelimiters = array(); $xentries = count($results); @@ -168,7 +167,10 @@ function getPercentValues($results, $delimiter) { #echo('<pre>'); print_r($results); exit; - global $slot, $slotsize, $dateformat_intra, $axis, $axispos, $availdelimiters, $max, $datehandler, $axislabelint, $i, $xentries; + global $slot, $slotsize, $dateformat_intra, $axis, $lastslot, $axispos, $availdelimiters, $max, $datehandler, $axislabelint, $i, $xentries; + + $axis = array(); + $axispos = array(); $dataset = array(); foreach($results AS $slot => $res) { @@ -184,7 +186,7 @@ function getPercentValues($results, $delimiter) { if ( $slot % $axislabelint == 0) { $axis[] = $datehandler->prettyDateSlot($slot, $slotsize, $dateformat_intra); $axispos[] = (($i)/($xentries-1)); - #echo 'set axis on [' . $slot . ']'; + // echo 'set axis on [' . $slot . '] = [' . $datehandler->prettyDateSlot($slot, $slotsize, $dateformat_intra) . ']'; } $lastslot = $slot; $i++; @@ -194,6 +196,8 @@ function getPercentValues($results, $delimiter) { } + + $datasets[] = getPercentValues($results, '_'); if ($delimiter !== '_') { if (array_key_exists('graph.total', $statrules[$rule]) && $statrules[$rule]['graph.total'] === TRUE) { @@ -205,6 +209,7 @@ if ($delimiter !== '_') { $axis[] = $datehandler->prettyDateSlot($lastslot+1, $slotsize, $dateformat_intra); #print_r($axis); +#echo('<pre>'); print_r($axis); exit; $dimx = $statconfig->getValue('dimension.x', 800); -- GitLab