PlotArea.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. class PHPExcel_Chart_PlotArea
  8. {
  9. /**
  10. * PlotArea Layout
  11. *
  12. * @var PHPExcel_Chart_Layout
  13. */
  14. private $layout = null;
  15. /**
  16. * Plot Series
  17. *
  18. * @var array of PHPExcel_Chart_DataSeries
  19. */
  20. private $plotSeries = array();
  21. /**
  22. * Create a new PHPExcel_Chart_PlotArea
  23. */
  24. public function __construct(PHPExcel_Chart_Layout $layout = null, $plotSeries = array())
  25. {
  26. $this->layout = $layout;
  27. $this->plotSeries = $plotSeries;
  28. }
  29. /**
  30. * Get Layout
  31. *
  32. * @return PHPExcel_Chart_Layout
  33. */
  34. public function getLayout()
  35. {
  36. return $this->layout;
  37. }
  38. /**
  39. * Get Number of Plot Groups
  40. *
  41. * @return array of PHPExcel_Chart_DataSeries
  42. */
  43. public function getPlotGroupCount()
  44. {
  45. return count($this->plotSeries);
  46. }
  47. /**
  48. * Get Number of Plot Series
  49. *
  50. * @return integer
  51. */
  52. public function getPlotSeriesCount()
  53. {
  54. $seriesCount = 0;
  55. foreach ($this->plotSeries as $plot) {
  56. $seriesCount += $plot->getPlotSeriesCount();
  57. }
  58. return $seriesCount;
  59. }
  60. /**
  61. * Get Plot Series
  62. *
  63. * @return array of PHPExcel_Chart_DataSeries
  64. */
  65. public function getPlotGroup()
  66. {
  67. return $this->plotSeries;
  68. }
  69. /**
  70. * Get Plot Series by Index
  71. *
  72. * @return PHPExcel_Chart_DataSeries
  73. */
  74. public function getPlotGroupByIndex($index)
  75. {
  76. return $this->plotSeries[$index];
  77. }
  78. /**
  79. * Set Plot Series
  80. *
  81. * @param [PHPExcel_Chart_DataSeries]
  82. * @return PHPExcel_Chart_PlotArea
  83. */
  84. public function setPlotSeries($plotSeries = array())
  85. {
  86. $this->plotSeries = $plotSeries;
  87. return $this;
  88. }
  89. public function refresh(PHPExcel_Worksheet $worksheet)
  90. {
  91. foreach ($this->plotSeries as $plotSeries) {
  92. $plotSeries->refresh($worksheet);
  93. }
  94. }
  95. }