diff --git a/modules/statistics/config-templates/statistics.php b/modules/statistics/config-templates/statistics.php index 57d7ca637893f81cbb27d3c58c7d6e425ecee446..61e74c7fae6c299eefd6b3473bbd5ce5553dbc4e 100644 --- a/modules/statistics/config-templates/statistics.php +++ b/modules/statistics/config-templates/statistics.php @@ -13,6 +13,10 @@ $config = array ( 'datelength' => 15, 'offsetspan' => 21, + // Dimensions on graph from Google Charts in pixels... + 'dimension.x' => 800, + 'dimension.y' => 350, + /* * Do you want to generate statistics using the cron module? If so, specify which cron tag to use. * Examples: daily, weekly diff --git a/modules/statistics/extlibs/loganalyzer.php b/modules/statistics/extlibs/loganalyzer.php index dfcb8e61df1dd6efa366a1430adcf8318c3e5e3b..a67a802c0e5b4b350b6c144ee91fbc79e77cc0bf 100755 --- a/modules/statistics/extlibs/loganalyzer.php +++ b/modules/statistics/extlibs/loganalyzer.php @@ -29,8 +29,12 @@ foreach ($logfile AS $logline) { $content = $logparser->parseContent($logline); $action = $content[4]; + // Iterate all the statrules from config. foreach ($statrules AS $rulename => $rule) { + + // echo 'Comparing action: [' . $rule['action'] . '] with [' . $action . ']'; + $timeslot = $datehandler->toSlot($epoch, $rule['slot']); $fileslot = $datehandler->toSlot($epoch, $rule['fileslot']); //print_r($content); if (isset($rule['action']) && ($action !== $rule['action'])) continue; diff --git a/modules/statistics/www/showstats.php b/modules/statistics/www/showstats.php index af907cac34431253d36142fc93c7502beb075961..1f6d94c64d213bb8dbe412b1e462d69ebf2805d4 100644 --- a/modules/statistics/www/showstats.php +++ b/modules/statistics/www/showstats.php @@ -151,8 +151,9 @@ foreach($results AS $slot => $res) { $axis[] = $datehandler->prettyDateSlot($lastslot+1, $slotsize, $dateformat_intra); #print_r($axis); - -$grapher = new sspmod_statistics_Graph_GoogleCharts(800, 350); +$dimx = $statconfig->getValue('dimension.x', 800); +$dimy = $statconfig->getValue('dimension.y', 350); +$grapher = new sspmod_statistics_Graph_GoogleCharts($dimx, $dimy); $t = new SimpleSAML_XHTML_Template($config, 'statistics:statistics-tpl.php'); $t->data['header'] = 'stat';