3 namespace PhpOffice\PhpSpreadsheet\Chart
;
5 use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet
;
21 private $plotSeries = [];
24 * Create a new PlotArea.
26 * @param null|Layout $layout
27 * @param DataSeries[] $plotSeries
29 public function __construct(Layout
$layout = null, array $plotSeries = [])
31 $this->layout
= $layout;
32 $this->plotSeries
= $plotSeries;
40 public function getLayout()
46 * Get Number of Plot Groups.
48 * @return array of DataSeries
50 public function getPlotGroupCount()
52 return count($this->plotSeries
);
56 * Get Number of Plot Series.
60 public function getPlotSeriesCount()
63 foreach ($this->plotSeries
as $plot) {
64 $seriesCount +
= $plot->getPlotSeriesCount();
73 * @return array of DataSeries
75 public function getPlotGroup()
77 return $this->plotSeries
;
81 * Get Plot Series by Index.
87 public function getPlotGroupByIndex($index)
89 return $this->plotSeries
[$index];
95 * @param DataSeries[] $plotSeries
99 public function setPlotSeries(array $plotSeries)
101 $this->plotSeries
= $plotSeries;
106 public function refresh(Worksheet
$worksheet)
108 foreach ($this->plotSeries
as $plotSeries) {
109 $plotSeries->refresh($worksheet);