diff options
Diffstat (limited to 'usage_chart.php')
| -rw-r--r-- | usage_chart.php | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/usage_chart.php b/usage_chart.php index da29b05..821bd02 100644 --- a/usage_chart.php +++ b/usage_chart.php @@ -15,10 +15,12 @@ /** * required setup - */ -require_once( '../kernel/includes/setup_inc.php' ); -include_once( STATS_PKG_PATH . "Statistics.php" ); -include_once( UTIL_PKG_INCLUDE_PATH . "phplot.php" ); +**/ +use Bitweaver\KernelTools; +use Bitweaver\Stats\Statistics; + +require_once '../kernel/includes/setup_inc.php'; +include_once UTIL_PKG_INCLUDE_PATH . "phplot.php"; global $gBitSystem; $gBitSystem->isPackageActive( 'stats' ); @@ -31,24 +33,23 @@ $data = $stats->getUsageChartData(); $chart_type = !empty( $_REQUEST['chart_type'] ) ? $_REQUEST['chart_type'] : 'bars'; // initialise phplot and insert data -$graph =& new PHPlot( 600, 400 ); -$graph->SetTitle( tra( 'Site Usage Statistics' ) ); +$graph = new PHPlot( 600, 400 ); +$graph->SetTitle( KernelTools::tra( 'Site Usage Statistics' ) ); $graph->SetPlotType( $chart_type ); if( $chart_type == 'pie' ) { $graph->SetShading( 20 ); - $graph->SetLegendPixels( 1, 30, FALSE ); + $graph->SetLegendPixels( 1, 30 ); $graph->SetLegend( $data['legend'] ); $graph->SetDataValues( $data['data'] ); } else { array_shift( $data['data'][0] ); foreach( $data['data'][0] as $key => $item ) { - $bars[] = array( $data['legend'][$key], $item ); + $bars[] = [ $data['legend'][$key], $item ]; } $graph->SetShading( 7 ); $graph->SetDataValues( $bars ); - $graph->SetDrawXDataLabels( TRUE ); + $graph->SetDrawXDataLabels( true ); $graph->SetXLabelAngle( ( count( $bars ) > 5 ) ? 90 : 0 ); $graph->SetXTickPos('none'); } $graph->DrawGraph(); -?> |
