PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.0.10
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.0.10
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
← All changes | vendor/phpoffice/phpexcel/Classes/PHPExcel/Chart.php +517 -562 3.1.23.0.10 View file →
@@ -1,10 +1,9 @@
1 1 <?php
2 -
3 2 /**
4 - * PHPExcel_Chart
3 + * PHPExcel
5 4 *
6 - * Copyright (c) 2006 - 2015 PHPExcel
5 + * Copyright (c) 2006 - 2014 PHPExcel
7 6 *
8 7 * This library is free software; you can redistribute it and/or
9 8 * modify it under the terms of the GNU Lesser General Public
10 9 * License as published by the Free Software Foundation; either
@@ -18,663 +17,619 @@
18 17 * You should have received a copy of the GNU Lesser General Public
19 18 * License along with this library; if not, write to the Free Software
20 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 20 *
22 - * @category PHPExcel
23 - * @package PHPExcel_Chart
24 - * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
25 - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
26 - * @version ##VERSION##, ##DATE##
21 + * @category PHPExcel
22 + * @package PHPExcel_Chart
23 + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
24 + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
25 + * @version ##VERSION##, ##DATE##
27 26 */
27 +
28 +
29 +/**
30 + * PHPExcel_Chart
31 + *
32 + * @category PHPExcel
33 + * @package PHPExcel_Chart
34 + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
35 + */
28 36 class PHPExcel_Chart
29 37 {
30 - /**
31 - * Chart Name
32 - *
33 - * @var string
34 - */
35 - private $name = '';
38 + /**
39 + * Chart Name
40 + *
41 + * @var string
42 + */
43 + private $_name = '';
36 44
37 - /**
38 - * Worksheet
39 - *
40 - * @var PHPExcel_Worksheet
41 - */
42 - private $worksheet;
45 + /**
46 + * Worksheet
47 + *
48 + * @var PHPExcel_Worksheet
49 + */
50 + private $_worksheet = null;
43 51
44 - /**
45 - * Chart Title
46 - *
47 - * @var PHPExcel_Chart_Title
48 - */
49 - private $title;
52 + /**
53 + * Chart Title
54 + *
55 + * @var PHPExcel_Chart_Title
56 + */
57 + private $_title = null;
50 58
51 - /**
52 - * Chart Legend
53 - *
54 - * @var PHPExcel_Chart_Legend
55 - */
56 - private $legend;
59 + /**
60 + * Chart Legend
61 + *
62 + * @var PHPExcel_Chart_Legend
63 + */
64 + private $_legend = null;
57 65
58 - /**
59 - * X-Axis Label
60 - *
61 - * @var PHPExcel_Chart_Title
62 - */
63 - private $xAxisLabel;
66 + /**
67 + * X-Axis Label
68 + *
69 + * @var PHPExcel_Chart_Title
70 + */
71 + private $_xAxisLabel = null;
64 72
65 - /**
66 - * Y-Axis Label
67 - *
68 - * @var PHPExcel_Chart_Title
69 - */
70 - private $yAxisLabel;
73 + /**
74 + * Y-Axis Label
75 + *
76 + * @var PHPExcel_Chart_Title
77 + */
78 + private $_yAxisLabel = null;
71 79
72 - /**
73 - * Chart Plot Area
74 - *
75 - * @var PHPExcel_Chart_PlotArea
76 - */
77 - private $plotArea;
80 + /**
81 + * Chart Plot Area
82 + *
83 + * @var PHPExcel_Chart_PlotArea
84 + */
85 + private $_plotArea = null;
78 86
79 - /**
80 - * Plot Visible Only
81 - *
82 - * @var boolean
83 - */
84 - private $plotVisibleOnly = true;
87 + /**
88 + * Plot Visible Only
89 + *
90 + * @var boolean
91 + */
92 + private $_plotVisibleOnly = true;
85 93
86 - /**
87 - * Display Blanks as
88 - *
89 - * @var string
90 - */
91 - private $displayBlanksAs = '0';
94 + /**
95 + * Display Blanks as
96 + *
97 + * @var string
98 + */
99 + private $_displayBlanksAs = '0';
92 100
93 - /**
94 - * Chart Asix Y as
95 - *
96 - * @var PHPExcel_Chart_Axis
97 - */
98 - private $yAxis;
101 + /**
102 + * Chart Asix Y as
103 + *
104 + * @var PHPExcel_Chart_Axis
105 + */
106 + private $_yAxis = null;
99 107
100 - /**
101 - * Chart Asix X as
102 - *
103 - * @var PHPExcel_Chart_Axis
104 - */
105 - private $xAxis;
108 + /**
109 + * Chart Asix X as
110 + *
111 + * @var PHPExcel_Chart_Axis
112 + */
113 + private $_xAxis = null;
106 114
107 - /**
108 - * Chart Major Gridlines as
109 - *
110 - * @var PHPExcel_Chart_GridLines
111 - */
112 - private $majorGridlines;
115 + /**
116 + * Chart Major Gridlines as
117 + *
118 + * @var PHPExcel_Chart_GridLines
119 + */
120 + private $_majorGridlines = null;
113 121
114 - /**
115 - * Chart Minor Gridlines as
116 - *
117 - * @var PHPExcel_Chart_GridLines
118 - */
119 - private $minorGridlines;
122 + /**
123 + * Chart Minor Gridlines as
124 + *
125 + * @var PHPExcel_Chart_GridLines
126 + */
127 + private $_minorGridlines = null;
120 128
121 - /**
122 - * Top-Left Cell Position
123 - *
124 - * @var string
125 - */
126 - private $topLeftCellRef = 'A1';
129 + /**
130 + * Top-Left Cell Position
131 + *
132 + * @var string
133 + */
134 + private $_topLeftCellRef = 'A1';
127 135
128 136
129 - /**
130 - * Top-Left X-Offset
131 - *
132 - * @var integer
133 - */
134 - private $topLeftXOffset = 0;
137 + /**
138 + * Top-Left X-Offset
139 + *
140 + * @var integer
141 + */
142 + private $_topLeftXOffset = 0;
135 143
136 144
137 - /**
138 - * Top-Left Y-Offset
139 - *
140 - * @var integer
141 - */
142 - private $topLeftYOffset = 0;
145 + /**
146 + * Top-Left Y-Offset
147 + *
148 + * @var integer
149 + */
150 + private $_topLeftYOffset = 0;
143 151
144 152
145 - /**
146 - * Bottom-Right Cell Position
147 - *
148 - * @var string
149 - */
150 - private $bottomRightCellRef = 'A1';
153 + /**
154 + * Bottom-Right Cell Position
155 + *
156 + * @var string
157 + */
158 + private $_bottomRightCellRef = 'A1';
151 159
152 160
153 - /**
154 - * Bottom-Right X-Offset
155 - *
156 - * @var integer
157 - */
158 - private $bottomRightXOffset = 10;
161 + /**
162 + * Bottom-Right X-Offset
163 + *
164 + * @var integer
165 + */
166 + private $_bottomRightXOffset = 10;
159 167
160 168
161 - /**
162 - * Bottom-Right Y-Offset
163 - *
164 - * @var integer
165 - */
166 - private $bottomRightYOffset = 10;
169 + /**
170 + * Bottom-Right Y-Offset
171 + *
172 + * @var integer
173 + */
174 + private $_bottomRightYOffset = 10;
167 175
168 176
169 - /**
170 - * Create a new PHPExcel_Chart
171 - */
172 - public function __construct($name, PHPExcel_Chart_Title $title = null, PHPExcel_Chart_Legend $legend = null, PHPExcel_Chart_PlotArea $plotArea = null, $plotVisibleOnly = true, $displayBlanksAs = '0', PHPExcel_Chart_Title $xAxisLabel = null, PHPExcel_Chart_Title $yAxisLabel = null, PHPExcel_Chart_Axis $xAxis = null, PHPExcel_Chart_Axis $yAxis = null, PHPExcel_Chart_GridLines $majorGridlines = null, PHPExcel_Chart_GridLines $minorGridlines = null)
173 - {
174 - $this->name = $name;
175 - $this->title = $title;
176 - $this->legend = $legend;
177 - $this->xAxisLabel = $xAxisLabel;
178 - $this->yAxisLabel = $yAxisLabel;
179 - $this->plotArea = $plotArea;
180 - $this->plotVisibleOnly = $plotVisibleOnly;
181 - $this->displayBlanksAs = $displayBlanksAs;
182 - $this->xAxis = $xAxis;
183 - $this->yAxis = $yAxis;
184 - $this->majorGridlines = $majorGridlines;
185 - $this->minorGridlines = $minorGridlines;
186 - }
177 + /**
178 + * Create a new PHPExcel_Chart
179 + */
180 + public function __construct($name, PHPExcel_Chart_Title $title = null, PHPExcel_Chart_Legend $legend = null, PHPExcel_Chart_PlotArea $plotArea = null, $plotVisibleOnly = true, $displayBlanksAs = '0', PHPExcel_Chart_Title $xAxisLabel = null, PHPExcel_Chart_Title $yAxisLabel = null, PHPExcel_Chart_Axis $xAxis = null, PHPExcel_Chart_Axis $yAxis = null, PHPExcel_Chart_GridLines $majorGridlines = null, PHPExcel_Chart_GridLines $minorGridlines = null)
181 + {
182 + $this->_name = $name;
183 + $this->_title = $title;
184 + $this->_legend = $legend;
185 + $this->_xAxisLabel = $xAxisLabel;
186 + $this->_yAxisLabel = $yAxisLabel;
187 + $this->_plotArea = $plotArea;
188 + $this->_plotVisibleOnly = $plotVisibleOnly;
189 + $this->_displayBlanksAs = $displayBlanksAs;
190 + $this->_xAxis = $xAxis;
191 + $this->_yAxis = $yAxis;
192 + $this->_majorGridlines = $majorGridlines;
193 + $this->_minorGridlines = $minorGridlines;
194 + }
187 195
188 - /**
189 - * Get Name
190 - *
191 - * @return string
192 - */
193 - public function getName()
194 - {
195 - return $this->name;
196 - }
196 + /**
197 + * Get Name
198 + *
199 + * @return string
200 + */
201 + public function getName() {
202 + return $this->_name;
203 + }
197 204
198 - /**
199 - * Get Worksheet
200 - *
201 - * @return PHPExcel_Worksheet
202 - */
203 - public function getWorksheet()
204 - {
205 - return $this->worksheet;
206 - }
205 + /**
206 + * Get Worksheet
207 + *
208 + * @return PHPExcel_Worksheet
209 + */
210 + public function getWorksheet() {
211 + return $this->_worksheet;
212 + }
207 213
208 - /**
209 - * Set Worksheet
210 - *
211 - * @param PHPExcel_Worksheet $pValue
212 - * @throws PHPExcel_Chart_Exception
213 - * @return PHPExcel_Chart
214 - */
215 - public function setWorksheet(PHPExcel_Worksheet $pValue = null)
216 - {
217 - $this->worksheet = $pValue;
214 + /**
215 + * Set Worksheet
216 + *
217 + * @param PHPExcel_Worksheet $pValue
218 + * @throws PHPExcel_Chart_Exception
219 + * @return PHPExcel_Chart
220 + */
221 + public function setWorksheet(PHPExcel_Worksheet $pValue = null) {
222 + $this->_worksheet = $pValue;
218 223
219 - return $this;
220 - }
224 + return $this;
225 + }
221 226
222 - /**
223 - * Get Title
224 - *
225 - * @return PHPExcel_Chart_Title
226 - */
227 - public function getTitle()
228 - {
229 - return $this->title;
230 - }
227 + /**
228 + * Get Title
229 + *
230 + * @return PHPExcel_Chart_Title
231 + */
232 + public function getTitle() {
233 + return $this->_title;
234 + }
231 235
232 - /**
233 - * Set Title
234 - *
235 - * @param PHPExcel_Chart_Title $title
236 - * @return PHPExcel_Chart
237 - */
238 - public function setTitle(PHPExcel_Chart_Title $title)
239 - {
240 - $this->title = $title;
236 + /**
237 + * Set Title
238 + *
239 + * @param PHPExcel_Chart_Title $title
240 + * @return PHPExcel_Chart
241 + */
242 + public function setTitle(PHPExcel_Chart_Title $title) {
243 + $this->_title = $title;
241 244
242 - return $this;
243 - }
245 + return $this;
246 + }
244 247
245 - /**
246 - * Get Legend
247 - *
248 - * @return PHPExcel_Chart_Legend
249 - */
250 - public function getLegend()
251 - {
252 - return $this->legend;
253 - }
248 + /**
249 + * Get Legend
250 + *
251 + * @return PHPExcel_Chart_Legend
252 + */
253 + public function getLegend() {
254 + return $this->_legend;
255 + }
254 256
255 - /**
256 - * Set Legend
257 - *
258 - * @param PHPExcel_Chart_Legend $legend
259 - * @return PHPExcel_Chart
260 - */
261 - public function setLegend(PHPExcel_Chart_Legend $legend)
262 - {
263 - $this->legend = $legend;
257 + /**
258 + * Set Legend
259 + *
260 + * @param PHPExcel_Chart_Legend $legend
261 + * @return PHPExcel_Chart
262 + */
263 + public function setLegend(PHPExcel_Chart_Legend $legend) {
264 + $this->_legend = $legend;
264 265
265 - return $this;
266 - }
266 + return $this;
267 + }
267 268
268 - /**
269 - * Get X-Axis Label
270 - *
271 - * @return PHPExcel_Chart_Title
272 - */
273 - public function getXAxisLabel()
274 - {
275 - return $this->xAxisLabel;
276 - }
269 + /**
270 + * Get X-Axis Label
271 + *
272 + * @return PHPExcel_Chart_Title
273 + */
274 + public function getXAxisLabel() {
275 + return $this->_xAxisLabel;
276 + }
277 277
278 - /**
279 - * Set X-Axis Label
280 - *
281 - * @param PHPExcel_Chart_Title $label
282 - * @return PHPExcel_Chart
283 - */
284 - public function setXAxisLabel(PHPExcel_Chart_Title $label)
285 - {
286 - $this->xAxisLabel = $label;
278 + /**
279 + * Set X-Axis Label
280 + *
281 + * @param PHPExcel_Chart_Title $label
282 + * @return PHPExcel_Chart
283 + */
284 + public function setXAxisLabel(PHPExcel_Chart_Title $label) {
285 + $this->_xAxisLabel = $label;
287 286
288 - return $this;
289 - }
287 + return $this;
288 + }
290 289
291 - /**
292 - * Get Y-Axis Label
293 - *
294 - * @return PHPExcel_Chart_Title
295 - */
296 - public function getYAxisLabel()
297 - {
298 - return $this->yAxisLabel;
299 - }
290 + /**
291 + * Get Y-Axis Label
292 + *
293 + * @return PHPExcel_Chart_Title
294 + */
295 + public function getYAxisLabel() {
296 + return $this->_yAxisLabel;
297 + }
300 298
301 - /**
302 - * Set Y-Axis Label
303 - *
304 - * @param PHPExcel_Chart_Title $label
305 - * @return PHPExcel_Chart
306 - */
307 - public function setYAxisLabel(PHPExcel_Chart_Title $label)
308 - {
309 - $this->yAxisLabel = $label;
299 + /**
300 + * Set Y-Axis Label
301 + *
302 + * @param PHPExcel_Chart_Title $label
303 + * @return PHPExcel_Chart
304 + */
305 + public function setYAxisLabel(PHPExcel_Chart_Title $label) {
306 + $this->_yAxisLabel = $label;
310 307
311 - return $this;
312 - }
308 + return $this;
309 + }
313 310
314 - /**
315 - * Get Plot Area
316 - *
317 - * @return PHPExcel_Chart_PlotArea
318 - */
319 - public function getPlotArea()
320 - {
321 - return $this->plotArea;
322 - }
311 + /**
312 + * Get Plot Area
313 + *
314 + * @return PHPExcel_Chart_PlotArea
315 + */
316 + public function getPlotArea() {
317 + return $this->_plotArea;
318 + }
323 319
324 - /**
325 - * Get Plot Visible Only
326 - *
327 - * @return boolean
328 - */
329 - public function getPlotVisibleOnly()
330 - {
331 - return $this->plotVisibleOnly;
332 - }
320 + /**
321 + * Get Plot Visible Only
322 + *
323 + * @return boolean
324 + */
325 + public function getPlotVisibleOnly() {
326 + return $this->_plotVisibleOnly;
327 + }
333 328
334 - /**
335 - * Set Plot Visible Only
336 - *
337 - * @param boolean $plotVisibleOnly
338 - * @return PHPExcel_Chart
339 - */
340 - public function setPlotVisibleOnly($plotVisibleOnly = true)
341 - {
342 - $this->plotVisibleOnly = $plotVisibleOnly;
329 + /**
330 + * Set Plot Visible Only
331 + *
332 + * @param boolean $plotVisibleOnly
333 + * @return PHPExcel_Chart
334 + */
335 + public function setPlotVisibleOnly($plotVisibleOnly = true) {
336 + $this->_plotVisibleOnly = $plotVisibleOnly;
343 337
344 - return $this;
345 - }
338 + return $this;
339 + }
346 340
347 - /**
348 - * Get Display Blanks as
349 - *
350 - * @return string
351 - */
352 - public function getDisplayBlanksAs()
353 - {
354 - return $this->displayBlanksAs;
355 - }
341 + /**
342 + * Get Display Blanks as
343 + *
344 + * @return string
345 + */
346 + public function getDisplayBlanksAs() {
347 + return $this->_displayBlanksAs;
348 + }
356 349
357 - /**
358 - * Set Display Blanks as
359 - *
360 - * @param string $displayBlanksAs
361 - * @return PHPExcel_Chart
362 - */
363 - public function setDisplayBlanksAs($displayBlanksAs = '0')
364 - {
365 - $this->displayBlanksAs = $displayBlanksAs;
350 + /**
351 + * Set Display Blanks as
352 + *
353 + * @param string $displayBlanksAs
354 + * @return PHPExcel_Chart
355 + */
356 + public function setDisplayBlanksAs($displayBlanksAs = '0') {
357 + $this->_displayBlanksAs = $displayBlanksAs;
358 + }
359 +
360 +
361 + /**
362 + * Get yAxis
363 + *
364 + * @return PHPExcel_Chart_Axis
365 + */
366 + public function getChartAxisY() {
367 + if($this->_yAxis !== NULL){
368 + return $this->_yAxis;
366 369 }
367 370
371 + return new PHPExcel_Chart_Axis();
372 + }
368 373
369 - /**
370 - * Get yAxis
371 - *
372 - * @return PHPExcel_Chart_Axis
373 - */
374 - public function getChartAxisY()
375 - {
376 - if ($this->yAxis !== null) {
377 - return $this->yAxis;
378 - }
379 -
380 - return new PHPExcel_Chart_Axis();
374 + /**
375 + * Get xAxis
376 + *
377 + * @return PHPExcel_Chart_Axis
378 + */
379 + public function getChartAxisX() {
380 + if($this->_xAxis !== NULL){
381 + return $this->_xAxis;
381 382 }
382 383
383 - /**
384 - * Get xAxis
385 - *
386 - * @return PHPExcel_Chart_Axis
387 - */
388 - public function getChartAxisX()
389 - {
390 - if ($this->xAxis !== null) {
391 - return $this->xAxis;
392 - }
384 + return new PHPExcel_Chart_Axis();
385 + }
393 386
394 - return new PHPExcel_Chart_Axis();
387 + /**
388 + * Get Major Gridlines
389 + *
390 + * @return PHPExcel_Chart_GridLines
391 + */
392 + public function getMajorGridlines() {
393 + if($this->_majorGridlines !== NULL){
394 + return $this->_majorGridlines;
395 395 }
396 396
397 - /**
398 - * Get Major Gridlines
399 - *
400 - * @return PHPExcel_Chart_GridLines
401 - */
402 - public function getMajorGridlines()
403 - {
404 - if ($this->majorGridlines !== null) {
405 - return $this->majorGridlines;
406 - }
397 + return new PHPExcel_Chart_GridLines();
398 + }
407 399
408 - return new PHPExcel_Chart_GridLines();
400 + /**
401 + * Get Minor Gridlines
402 + *
403 + * @return PHPExcel_Chart_GridLines
404 + */
405 + public function getMinorGridlines() {
406 + if($this->_minorGridlines !== NULL){
407 + return $this->_minorGridlines;
409 408 }
410 409
411 - /**
412 - * Get Minor Gridlines
413 - *
414 - * @return PHPExcel_Chart_GridLines
415 - */
416 - public function getMinorGridlines()
417 - {
418 - if ($this->minorGridlines !== null) {
419 - return $this->minorGridlines;
420 - }
410 + return new PHPExcel_Chart_GridLines();
411 + }
421 412
422 - return new PHPExcel_Chart_GridLines();
423 - }
424 413
414 + /**
415 + * Set the Top Left position for the chart
416 + *
417 + * @param string $cell
418 + * @param integer $xOffset
419 + * @param integer $yOffset
420 + * @return PHPExcel_Chart
421 + */
422 + public function setTopLeftPosition($cell, $xOffset=null, $yOffset=null) {
423 + $this->_topLeftCellRef = $cell;
424 + if (!is_null($xOffset))
425 + $this->setTopLeftXOffset($xOffset);
426 + if (!is_null($yOffset))
427 + $this->setTopLeftYOffset($yOffset);
425 428
426 - /**
427 - * Set the Top Left position for the chart
428 - *
429 - * @param string $cell
430 - * @param integer $xOffset
431 - * @param integer $yOffset
432 - * @return PHPExcel_Chart
433 - */
434 - public function setTopLeftPosition($cell, $xOffset = null, $yOffset = null)
435 - {
436 - $this->topLeftCellRef = $cell;
437 - if (!is_null($xOffset)) {
438 - $this->setTopLeftXOffset($xOffset);
439 - }
440 - if (!is_null($yOffset)) {
441 - $this->setTopLeftYOffset($yOffset);
442 - }
429 + return $this;
430 + }
443 431
444 - return $this;
445 - }
432 + /**
433 + * Get the top left position of the chart
434 + *
435 + * @return array an associative array containing the cell address, X-Offset and Y-Offset from the top left of that cell
436 + */
437 + public function getTopLeftPosition() {
438 + return array( 'cell' => $this->_topLeftCellRef,
439 + 'xOffset' => $this->_topLeftXOffset,
440 + 'yOffset' => $this->_topLeftYOffset
441 + );
442 + }
446 443
447 - /**
448 - * Get the top left position of the chart
449 - *
450 - * @return array an associative array containing the cell address, X-Offset and Y-Offset from the top left of that cell
451 - */
452 - public function getTopLeftPosition()
453 - {
454 - return array(
455 - 'cell' => $this->topLeftCellRef,
456 - 'xOffset' => $this->topLeftXOffset,
457 - 'yOffset' => $this->topLeftYOffset
458 - );
459 - }
444 + /**
445 + * Get the cell address where the top left of the chart is fixed
446 + *
447 + * @return string
448 + */
449 + public function getTopLeftCell() {
450 + return $this->_topLeftCellRef;
451 + }
460 452
461 - /**
462 - * Get the cell address where the top left of the chart is fixed
463 - *
464 - * @return string
465 - */
466 - public function getTopLeftCell()
467 - {
468 - return $this->topLeftCellRef;
469 - }
453 + /**
454 + * Set the Top Left cell position for the chart
455 + *
456 + * @param string $cell
457 + * @return PHPExcel_Chart
458 + */
459 + public function setTopLeftCell($cell) {
460 + $this->_topLeftCellRef = $cell;
470 461
471 - /**
472 - * Set the Top Left cell position for the chart
473 - *
474 - * @param string $cell
475 - * @return PHPExcel_Chart
476 - */
477 - public function setTopLeftCell($cell)
478 - {
479 - $this->topLeftCellRef = $cell;
462 + return $this;
463 + }
480 464
481 - return $this;
482 - }
465 + /**
466 + * Set the offset position within the Top Left cell for the chart
467 + *
468 + * @param integer $xOffset
469 + * @param integer $yOffset
470 + * @return PHPExcel_Chart
471 + */
472 + public function setTopLeftOffset($xOffset=null,$yOffset=null) {
473 + if (!is_null($xOffset))
474 + $this->setTopLeftXOffset($xOffset);
475 + if (!is_null($yOffset))
476 + $this->setTopLeftYOffset($yOffset);
483 477
484 - /**
485 - * Set the offset position within the Top Left cell for the chart
486 - *
487 - * @param integer $xOffset
488 - * @param integer $yOffset
489 - * @return PHPExcel_Chart
490 - */
491 - public function setTopLeftOffset($xOffset = null, $yOffset = null)
492 - {
493 - if (!is_null($xOffset)) {
494 - $this->setTopLeftXOffset($xOffset);
495 - }
496 - if (!is_null($yOffset)) {
497 - $this->setTopLeftYOffset($yOffset);
498 - }
478 + return $this;
479 + }
499 480
500 - return $this;
501 - }
481 + /**
482 + * Get the offset position within the Top Left cell for the chart
483 + *
484 + * @return integer[]
485 + */
486 + public function getTopLeftOffset() {
487 + return array( 'X' => $this->_topLeftXOffset,
488 + 'Y' => $this->_topLeftYOffset
489 + );
490 + }
502 491
503 - /**
504 - * Get the offset position within the Top Left cell for the chart
505 - *
506 - * @return integer[]
507 - */
508 - public function getTopLeftOffset()
509 - {
510 - return array(
511 - 'X' => $this->topLeftXOffset,
512 - 'Y' => $this->topLeftYOffset
513 - );
514 - }
492 + public function setTopLeftXOffset($xOffset) {
493 + $this->_topLeftXOffset = $xOffset;
515 494
516 - public function setTopLeftXOffset($xOffset)
517 - {
518 - $this->topLeftXOffset = $xOffset;
495 + return $this;
496 + }
519 497
520 - return $this;
521 - }
498 + public function getTopLeftXOffset() {
499 + return $this->_topLeftXOffset;
500 + }
522 501
523 - public function getTopLeftXOffset()
524 - {
525 - return $this->topLeftXOffset;
526 - }
502 + public function setTopLeftYOffset($yOffset) {
503 + $this->_topLeftYOffset = $yOffset;
527 504
528 - public function setTopLeftYOffset($yOffset)
529 - {
530 - $this->topLeftYOffset = $yOffset;
505 + return $this;
506 + }
531 507
532 - return $this;
533 - }
508 + public function getTopLeftYOffset() {
509 + return $this->_topLeftYOffset;
510 + }
534 511
535 - public function getTopLeftYOffset()
536 - {
537 - return $this->topLeftYOffset;
538 - }
512 + /**
513 + * Set the Bottom Right position of the chart
514 + *
515 + * @param string $cell
516 + * @param integer $xOffset
517 + * @param integer $yOffset
518 + * @return PHPExcel_Chart
519 + */
520 + public function setBottomRightPosition($cell, $xOffset=null, $yOffset=null) {
521 + $this->_bottomRightCellRef = $cell;
522 + if (!is_null($xOffset))
523 + $this->setBottomRightXOffset($xOffset);
524 + if (!is_null($yOffset))
525 + $this->setBottomRightYOffset($yOffset);
539 526
540 - /**
541 - * Set the Bottom Right position of the chart
542 - *
543 - * @param string $cell
544 - * @param integer $xOffset
545 - * @param integer $yOffset
546 - * @return PHPExcel_Chart
547 - */
548 - public function setBottomRightPosition($cell, $xOffset = null, $yOffset = null)
549 - {
550 - $this->bottomRightCellRef = $cell;
551 - if (!is_null($xOffset)) {
552 - $this->setBottomRightXOffset($xOffset);
553 - }
554 - if (!is_null($yOffset)) {
555 - $this->setBottomRightYOffset($yOffset);
556 - }
527 + return $this;
528 + }
557 529
558 - return $this;
559 - }
530 + /**
531 + * Get the bottom right position of the chart
532 + *
533 + * @return array an associative array containing the cell address, X-Offset and Y-Offset from the top left of that cell
534 + */
535 + public function getBottomRightPosition() {
536 + return array( 'cell' => $this->_bottomRightCellRef,
537 + 'xOffset' => $this->_bottomRightXOffset,
538 + 'yOffset' => $this->_bottomRightYOffset
539 + );
540 + }
560 541
561 - /**
562 - * Get the bottom right position of the chart
563 - *
564 - * @return array an associative array containing the cell address, X-Offset and Y-Offset from the top left of that cell
565 - */
566 - public function getBottomRightPosition()
567 - {
568 - return array(
569 - 'cell' => $this->bottomRightCellRef,
570 - 'xOffset' => $this->bottomRightXOffset,
571 - 'yOffset' => $this->bottomRightYOffset
572 - );
573 - }
542 + public function setBottomRightCell($cell) {
543 + $this->_bottomRightCellRef = $cell;
574 544
575 - public function setBottomRightCell($cell)
576 - {
577 - $this->bottomRightCellRef = $cell;
545 + return $this;
546 + }
578 547
579 - return $this;
580 - }
548 + /**
549 + * Get the cell address where the bottom right of the chart is fixed
550 + *
551 + * @return string
552 + */
553 + public function getBottomRightCell() {
554 + return $this->_bottomRightCellRef;
555 + }
581 556
582 - /**
583 - * Get the cell address where the bottom right of the chart is fixed
584 - *
585 - * @return string
586 - */
587 - public function getBottomRightCell()
588 - {
589 - return $this->bottomRightCellRef;
590 - }
557 + /**
558 + * Set the offset position within the Bottom Right cell for the chart
559 + *
560 + * @param integer $xOffset
561 + * @param integer $yOffset
562 + * @return PHPExcel_Chart
563 + */
564 + public function setBottomRightOffset($xOffset=null,$yOffset=null) {
565 + if (!is_null($xOffset))
566 + $this->setBottomRightXOffset($xOffset);
567 + if (!is_null($yOffset))
568 + $this->setBottomRightYOffset($yOffset);
591 569
592 - /**
593 - * Set the offset position within the Bottom Right cell for the chart
594 - *
595 - * @param integer $xOffset
596 - * @param integer $yOffset
597 - * @return PHPExcel_Chart
598 - */
599 - public function setBottomRightOffset($xOffset = null, $yOffset = null)
600 - {
601 - if (!is_null($xOffset)) {
602 - $this->setBottomRightXOffset($xOffset);
603 - }
604 - if (!is_null($yOffset)) {
605 - $this->setBottomRightYOffset($yOffset);
606 - }
570 + return $this;
571 + }
607 572
608 - return $this;
609 - }
573 + /**
574 + * Get the offset position within the Bottom Right cell for the chart
575 + *
576 + * @return integer[]
577 + */
578 + public function getBottomRightOffset() {
579 + return array( 'X' => $this->_bottomRightXOffset,
580 + 'Y' => $this->_bottomRightYOffset
581 + );
582 + }
610 583
611 - /**
612 - * Get the offset position within the Bottom Right cell for the chart
613 - *
614 - * @return integer[]
615 - */
616 - public function getBottomRightOffset()
617 - {
618 - return array(
619 - 'X' => $this->bottomRightXOffset,
620 - 'Y' => $this->bottomRightYOffset
621 - );
622 - }
584 + public function setBottomRightXOffset($xOffset) {
585 + $this->_bottomRightXOffset = $xOffset;
623 586
624 - public function setBottomRightXOffset($xOffset)
625 - {
626 - $this->bottomRightXOffset = $xOffset;
587 + return $this;
588 + }
627 589
628 - return $this;
629 - }
590 + public function getBottomRightXOffset() {
591 + return $this->_bottomRightXOffset;
592 + }
630 593
631 - public function getBottomRightXOffset()
632 - {
633 - return $this->bottomRightXOffset;
634 - }
594 + public function setBottomRightYOffset($yOffset) {
595 + $this->_bottomRightYOffset = $yOffset;
635 596
636 - public function setBottomRightYOffset($yOffset)
637 - {
638 - $this->bottomRightYOffset = $yOffset;
597 + return $this;
598 + }
639 599
640 - return $this;
641 - }
600 + public function getBottomRightYOffset() {
601 + return $this->_bottomRightYOffset;
602 + }
642 603
643 - public function getBottomRightYOffset()
644 - {
645 - return $this->bottomRightYOffset;
646 - }
647 604
605 + public function refresh() {
606 + if ($this->_worksheet !== NULL) {
607 + $this->_plotArea->refresh($this->_worksheet);
608 + }
609 + }
648 610
649 - public function refresh()
650 - {
651 - if ($this->worksheet !== null) {
652 - $this->plotArea->refresh($this->worksheet);
653 - }
654 - }
611 + public function render($outputDestination = null) {
612 + $libraryName = PHPExcel_Settings::getChartRendererName();
613 + if (is_null($libraryName)) {
614 + return false;
615 + }
616 + // Ensure that data series values are up-to-date before we render
617 + $this->refresh();
655 618
656 - public function render($outputDestination = null)
657 - {
658 - $libraryName = PHPExcel_Settings::getChartRendererName();
659 - if (is_null($libraryName)) {
660 - return false;
661 - }
662 - // Ensure that data series values are up-to-date before we render
663 - $this->refresh();
619 + $libraryPath = PHPExcel_Settings::getChartRendererPath();
620 + $includePath = str_replace('\\','/',get_include_path());
621 + $rendererPath = str_replace('\\','/',$libraryPath);
622 + if (strpos($rendererPath,$includePath) === false) {
623 + set_include_path(get_include_path() . PATH_SEPARATOR . $libraryPath);
624 + }
664 625
665 - $libraryPath = PHPExcel_Settings::getChartRendererPath();
666 - $includePath = str_replace('\\', '/', get_include_path());
667 - $rendererPath = str_replace('\\', '/', $libraryPath);
668 - if (strpos($rendererPath, $includePath) === false) {
669 - set_include_path(get_include_path() . PATH_SEPARATOR . $libraryPath);
670 - }
626 + $rendererName = 'PHPExcel_Chart_Renderer_'.$libraryName;
627 + $renderer = new $rendererName($this);
671 628
672 - $rendererName = 'PHPExcel_Chart_Renderer_'.$libraryName;
673 - $renderer = new $rendererName($this);
629 + if ($outputDestination == 'php://output') {
630 + $outputDestination = null;
631 + }
632 + return $renderer->render($outputDestination);
633 + }
674 634
675 - if ($outputDestination == 'php://output') {
676 - $outputDestination = null;
677 - }
678 - return $renderer->render($outputDestination);
679 - }
680 635 }