| @@ -37,8 +37,10 @@ | ||
| 37 | 37 | * @var DataSeries[] |
| 38 | 38 | */ |
| 39 | 39 | private array $plotSeries; |
| 40 | 40 | |
| 41 | + private ?DataTable $dataTable = null; | |
| 42 | + | |
| 41 | 43 | /** |
| 42 | 44 | * Create a new PlotArea. |
| 43 | 45 | * |
| 44 | 46 | * @param DataSeries[] $plotSeries |
| @@ -63,9 +65,9 @@ | ||
| 63 | 65 | } |
| 64 | 66 | |
| 65 | 67 | /** |
| 66 | 68 | * Get Number of Plot Series. |
| 67 | - * @return float|int | |
| 69 | + * @return int|float | |
| 68 | 70 | */ |
| 69 | 71 | public function getPlotSeriesCount() |
| 70 | 72 | { |
| 71 | 73 | $seriesCount = 0; |
| @@ -195,8 +197,20 @@ | ||
| 195 | 197 | |
| 196 | 198 | return $this; |
| 197 | 199 | } |
| 198 | 200 | |
| 201 | + public function setDataTable(DataTable $dataTable): self | |
| 202 | + { | |
| 203 | + $this->dataTable = $dataTable; | |
| 204 | + | |
| 205 | + return $this; | |
| 206 | + } | |
| 207 | + | |
| 208 | + public function getDataTable(): ?DataTable | |
| 209 | + { | |
| 210 | + return $this->dataTable; | |
| 211 | + } | |
| 212 | + | |
| 199 | 213 | /** |
| 200 | 214 | * Implement PHP __clone to create a deep clone, not just a shallow copy. |
| 201 | 215 | */ |
| 202 | 216 | public function __clone() |
| @@ -201,11 +215,17 @@ | ||
| 201 | 215 | */ |
| 202 | 216 | public function __clone() |
| 203 | 217 | { |
| 204 | 218 | $this->layout = ($this->layout === null) ? null : clone $this->layout; |
| 219 | + $this->dataTable = ($this->dataTable === null) ? null : clone $this->dataTable; | |
| 205 | 220 | $plotSeries = $this->plotSeries; |
| 206 | 221 | $this->plotSeries = []; |
| 207 | 222 | foreach ($plotSeries as $series) { |
| 208 | 223 | $this->plotSeries[] = clone $series; |
| 224 | + } | |
| 225 | + $gradientFillStops = $this->gradientFillStops; | |
| 226 | + $this->gradientFillStops = []; | |
| 227 | + foreach ($gradientFillStops as $gradientFillStop) { | |
| 228 | + $this->gradientFillStops[] = [$gradientFillStop[0], clone $gradientFillStop[1]]; | |
| 209 | 229 | } |
| 210 | 230 | } |
| 211 | 231 | } |