summaryrefslogtreecommitdiff
path: root/pv_chart.php
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2005-12-26 12:26:04 +0000
committerMax Kremmel <xing@synapse.plus.com>2005-12-26 12:26:04 +0000
commit26657f342470a90c8014c0a25de0889fb66d01bf (patch)
tree7d023ecb4a5537f3c699f847f1197350a03b3de8 /pv_chart.php
parent758e8420c43ae135dd35b96941d397b7c6009238 (diff)
downloadstats-26657f342470a90c8014c0a25de0889fb66d01bf.tar.gz
stats-26657f342470a90c8014c0a25de0889fb66d01bf.tar.bz2
stats-26657f342470a90c8014c0a25de0889fb66d01bf.zip
merge recent changes into HEAD
Diffstat (limited to 'pv_chart.php')
-rw-r--r--pv_chart.php30
1 files changed, 14 insertions, 16 deletions
diff --git a/pv_chart.php b/pv_chart.php
index 2de82af..62e3229 100644
--- a/pv_chart.php
+++ b/pv_chart.php
@@ -1,6 +1,6 @@
<?php
/**
- * $Header: /cvsroot/bitweaver/_bit_stats/pv_chart.php,v 1.3 2005/08/24 20:57:55 squareing Exp $
+ * $Header: /cvsroot/bitweaver/_bit_stats/pv_chart.php,v 1.4 2005/12/26 12:26:04 squareing Exp $
*
* Copyright (c) 2004 bitweaver.org
* Copyright (c) 2003 tikwiki.org
@@ -8,7 +8,7 @@
* All Rights Reserved. See copyright.txt for details and a complete list of authors.
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
*
- * $Id: pv_chart.php,v 1.3 2005/08/24 20:57:55 squareing Exp $
+ * $Id: pv_chart.php,v 1.4 2005/12/26 12:26:04 squareing Exp $
* @package stats
* @subpackage functions
*/
@@ -25,20 +25,18 @@ global $gBitSystem;
$gBitSystem->isPackageActive( 'stats' );
$gBitSystem->verifyPermission( 'bit_p_view_stats' );
-//Define the object
-$graph = new PHPlot;
+$days = isset( $_REQUEST["days"] ) ? $_REQUEST['days'] : 7;
+$data = $statslib->get_pv_chart_data( $days );
-//Set some data
-if (!isset($_REQUEST["days"]))
- $_REQUEST["days"] = 7;
-
-$example_data = $statslib->get_pv_chart_data($_REQUEST["days"]);
-$graph->SetDataValues($example_data);
-//$graph->SetPlotType('bars');
-$graph->SetPlotType('lines');
-$graph->SetYLabel(tra('pageviews'));
-$graph->SetXLabel(tra('day'));
-//Draw it
+// initialise phplot and insert data
+$graph =& new PHPlot( 600, 600 );
+$graph->SetDataValues( $data );
+$graph->SetTitle( tra( 'Total Pageviews' ) );
+$graph->SetYTitle( tra( 'Pageviews' ) );
+$graph->SetXTitle( tra( 'Days') );
+$graph->SetPlotType( ( count( $data ) > 50 ) ? 'lines' : 'linepoints' );
+$graph->SetDrawXDataLabels( TRUE );
+$graph->SetXLabelAngle( 90 );
+$graph->SetXTickPos('none');
$graph->DrawGraph();
-
?>