stats
[ class tree: stats ] [ index: stats ] [ all elements ]

Source for file usage_chart.php

Documentation is available at usage_chart.php

  1. <?php
  2. /**
  3.  * $Header: /cvsroot/bitweaver/_bit_stats/usage_chart.php,v 1.4 2006/04/11 13:09:28 squareing Exp $
  4.  *
  5.  * Copyright (c) 2004 bitweaver.org
  6.  * Copyright (c) 2003 tikwiki.org
  7.  * Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
  8.  * All Rights Reserved. See copyright.txt for details and a complete list of authors.
  9.  * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
  10.  *
  11.  * $Id: usage_chart.php,v 1.4 2006/04/11 13:09:28 squareing Exp $
  12.  * @package stats
  13.  * @subpackage functions
  14.  */
  15.  
  16. /**
  17.  * required setup
  18.  */
  19. require_once'../bit_setup_inc.php' );
  20. include_onceSTATS_PKG_PATH "stats_lib.php" );
  21. include_onceUTIL_PKG_PATH "phplot.php" );
  22. global $gBitSystem;
  23.  
  24. $gBitSystem->isPackageActive'stats' );
  25. $gBitSystem->verifyPermission'p_stats_view' );
  26.  
  27. // data to be displayed
  28. $data $statslib->get_usage_chart_data();
  29.  
  30. $chart_type !empty$_REQUEST['chart_type'$_REQUEST['chart_type''bars';
  31.  
  32. // initialise phplot and insert data
  33. $graph =new PHPlot600400 );
  34. $graph->SetTitletra'Site Usage Statistics' ) );
  35. $graph->SetPlotType$chart_type );
  36. if$chart_type == 'pie' {
  37.     $graph->SetShading20 );
  38.     $graph->SetLegendPixels130FALSE );
  39.     $graph->SetLegend$data['legend');
  40.     $graph->SetDataValues$data['data');
  41. else {
  42.     array_shift$data['data'][0);
  43.     foreach$data['data'][0as $key => $item {
  44.         $bars[array$data['legend'][$key]$item );
  45.     }
  46.     $graph->SetShading);
  47.     $graph->SetDataValues$bars );
  48.     $graph->SetDrawXDataLabelsTRUE );
  49.     $graph->SetXLabelAngle( ( count$bars 90 );
  50.     $graph->SetXTickPos('none');
  51. }
  52. $graph->DrawGraph();
  53. ?>

Documentation generated on Thu, 15 Feb 2007 20:50:43 +0000 by phpDocumentor 1.3.0