Skip to content
Snippets Groups Projects
Commit f9caf568 authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Adding configuration option for dimensions in pixels on statistics graphical frontend

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1037 44740490-163a-0410-bde0-09ae8108e29a
parent 118a03cf
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,10 @@ $config = array ( ...@@ -13,6 +13,10 @@ $config = array (
'datelength' => 15, 'datelength' => 15,
'offsetspan' => 21, '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. * Do you want to generate statistics using the cron module? If so, specify which cron tag to use.
* Examples: daily, weekly * Examples: daily, weekly
......
...@@ -29,8 +29,12 @@ foreach ($logfile AS $logline) { ...@@ -29,8 +29,12 @@ foreach ($logfile AS $logline) {
$content = $logparser->parseContent($logline); $content = $logparser->parseContent($logline);
$action = $content[4]; $action = $content[4];
// Iterate all the statrules from config. // Iterate all the statrules from config.
foreach ($statrules AS $rulename => $rule) { foreach ($statrules AS $rulename => $rule) {
// echo 'Comparing action: [' . $rule['action'] . '] with [' . $action . ']';
$timeslot = $datehandler->toSlot($epoch, $rule['slot']); $timeslot = $datehandler->toSlot($epoch, $rule['slot']);
$fileslot = $datehandler->toSlot($epoch, $rule['fileslot']); //print_r($content); $fileslot = $datehandler->toSlot($epoch, $rule['fileslot']); //print_r($content);
if (isset($rule['action']) && ($action !== $rule['action'])) continue; if (isset($rule['action']) && ($action !== $rule['action'])) continue;
......
...@@ -151,8 +151,9 @@ foreach($results AS $slot => $res) { ...@@ -151,8 +151,9 @@ foreach($results AS $slot => $res) {
$axis[] = $datehandler->prettyDateSlot($lastslot+1, $slotsize, $dateformat_intra); $axis[] = $datehandler->prettyDateSlot($lastslot+1, $slotsize, $dateformat_intra);
#print_r($axis); #print_r($axis);
$dimx = $statconfig->getValue('dimension.x', 800);
$grapher = new sspmod_statistics_Graph_GoogleCharts(800, 350); $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 = new SimpleSAML_XHTML_Template($config, 'statistics:statistics-tpl.php');
$t->data['header'] = 'stat'; $t->data['header'] = 'stat';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment