PageRenderTime 38ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/MantisBT/library/ezc/Graph/src/charts/bar.php

https://bitbucket.org/crypticrod/sr_wp_code
PHP | 94 lines | 14 code | 3 blank | 77 comment | 0 complexity | 9c35b9ac25832eb4d0913e5de6a7a5d6 MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, LGPL-2.1, GPL-3.0, LGPL-2.0, AGPL-3.0
  1. <?php
  2. /**
  3. * File containing the ezcGraphBarChart class
  4. *
  5. * @package Graph
  6. * @version 1.5
  7. * @copyright Copyright (C) 2005-2009 eZ Systems AS. All rights reserved.
  8. * @license http://ez.no/licenses/new_bsd New BSD License
  9. */
  10. /**
  11. * Class for bar charts. Can make use of an unlimited amount of datasets and
  12. * will display them as bars by default.
  13. * X axis:
  14. * - Labeled axis
  15. * - Boxed axis label renderer
  16. * Y axis:
  17. * - Numeric axis
  18. * - Exact axis label renderer
  19. *
  20. * <code>
  21. * // Create a new line chart
  22. * $chart = new ezcGraphBarChart();
  23. *
  24. * // Add data to line chart
  25. * $chart->data['sample dataset'] = new ezcGraphArrayDataSet(
  26. * array(
  27. * '100' => 1.2,
  28. * '200' => 43.2,
  29. * '300' => -34.14,
  30. * '350' => 65,
  31. * '400' => 123,
  32. * )
  33. * );
  34. *
  35. * // Render chart with default 2d renderer and default SVG driver
  36. * $chart->render( 500, 200, 'bar_chart.svg' );
  37. * </code>
  38. *
  39. * Each chart consists of several chart elements which represents logical
  40. * parts of the chart and can be formatted independently. The bar chart
  41. * consists of:
  42. * - title ( {@link ezcGraphChartElementText} )
  43. * - legend ( {@link ezcGraphChartElementLegend} )
  44. * - background ( {@link ezcGraphChartElementBackground} )
  45. * - xAxis ( {@link ezcGraphChartElementLabeledAxis} )
  46. * - yAxis ( {@link ezcGraphChartElementNumericAxis} )
  47. *
  48. * The type of the axis may be changed and all elements can be configured by
  49. * accessing them as properties of the chart:
  50. *
  51. * <code>
  52. * $chart->legend->position = ezcGraph::RIGHT;
  53. * </code>
  54. *
  55. * The chart itself also offers several options to configure the appearance. As
  56. * bar charts extend line charts the the extended configure options are
  57. * available in {@link ezcGraphLineChartOptions} extending the
  58. * {@link ezcGraphChartOptions}.
  59. *
  60. * @property ezcGraphLineChartOptions $options
  61. * Chart options class
  62. *
  63. * @version 1.5
  64. * @package Graph
  65. * @mainclass
  66. */
  67. class ezcGraphBarChart extends ezcGraphLineChart
  68. {
  69. /**
  70. * Constructor
  71. *
  72. * @param array $options Default option array
  73. * @return void
  74. * @ignore
  75. */
  76. public function __construct( array $options = array() )
  77. {
  78. parent::__construct();
  79. $this->elements['xAxis']->axisLabelRenderer = new ezcGraphAxisBoxedLabelRenderer();
  80. }
  81. /**
  82. * Returns the default display type of the current chart type.
  83. *
  84. * @return int Display type
  85. */
  86. public function getDefaultDisplayType()
  87. {
  88. return ezcGraph::BAR;
  89. }
  90. }
  91. ?>