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

Source for file item_chart.php

Documentation is available at item_chart.php

  1. <?php
  2. /**
  3.  * $Header: /cvsroot/bitweaver/_bit_stats/item_chart.php,v 1.3 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: item_chart.php,v 1.3 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_item_chart_data!empty$_REQUEST['content_type_guid'$_REQUEST['content_type_guid'NULL );
  29. $chart_type !empty$_REQUEST['chart_type'$_REQUEST['chart_type''points';
  30.  
  31. if!empty$_REQUEST['content_type_guid') ) {
  32.     $data['data'$data['data'][$_REQUEST['content_type_guid']];
  33. }
  34. // initialise phplot and insert data
  35. $graph =new PHPlot600400 count$data['data') ) );
  36. $graph->SetPrintImage(0);
  37. $graph->SetPlotType$chart_type );
  38. $graph->SetXTickPos'none' );
  39. $graph->SetYScaleType'log' );
  40. $graph->SetTitletra$data['title') );
  41. $graph->SetXLabeltra'Title' ) );
  42.  
  43. $i 0;
  44. foreach$data['data'as $guid => $info {
  45.     $graph->SetDataValues$info );
  46.     $graph->SetDrawXDataLabelsTRUE );
  47.     $graph->SetXLabelAngle( ( count$info 90 );
  48.     $graph->SetNewPlotAreaPixels7530 $i 390 )580280 $i 390 ) );
  49.     if!empty$_REQUEST['content_type_guid') ) {
  50.         $graph->SetYLabel$gLibertySystem->mContentTypes[$_REQUEST['content_type_guid']]['content_description'].' '.tra'Hits' ).' ('.tra"log" ).')' );
  51.     else {
  52.         $graph->SetYLabel$gLibertySystem->mContentTypes[$guid]['content_description'].' '.tra'Hits' ).' ('.tra"log" ).')' );
  53.     }
  54.     $graph->DrawGraph();
  55.     $i++;
  56. }
  57. $graph->PrintImage();
  58. ?>

Documentation generated on Thu, 15 Feb 2007 20:41:45 +0000 by phpDocumentor 1.3.0