[1] | 1 | <?php |
---|
| 2 | /** |
---|
| 3 | * PHPExcel |
---|
| 4 | * |
---|
| 5 | * Copyright (c) 2006 - 2014 PHPExcel |
---|
| 6 | * |
---|
| 7 | * This library is free software; you can redistribute it and/or |
---|
| 8 | * modify it under the terms of the GNU Lesser General Public |
---|
| 9 | * License as published by the Free Software Foundation; either |
---|
| 10 | * version 2.1 of the License, or (at your option) any later version. |
---|
| 11 | * |
---|
| 12 | * This library is distributed in the hope that it will be useful, |
---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
| 15 | * Lesser General Public License for more details. |
---|
| 16 | * |
---|
| 17 | * You should have received a copy of the GNU Lesser General Public |
---|
| 18 | * License along with this library; if not, write to the Free Software |
---|
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
---|
| 20 | * |
---|
| 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 1.8.0, 2014-03-02 |
---|
| 26 | */ |
---|
| 27 | |
---|
| 28 | |
---|
| 29 | /** |
---|
| 30 | * PHPExcel_Chart_PlotArea |
---|
| 31 | * |
---|
| 32 | * @category PHPExcel |
---|
| 33 | * @package PHPExcel_Chart |
---|
| 34 | * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) |
---|
| 35 | */ |
---|
| 36 | class PHPExcel_Chart_PlotArea |
---|
| 37 | { |
---|
| 38 | /** |
---|
| 39 | * PlotArea Layout |
---|
| 40 | * |
---|
| 41 | * @var PHPExcel_Chart_Layout |
---|
| 42 | */ |
---|
| 43 | private $_layout = null; |
---|
| 44 | |
---|
| 45 | /** |
---|
| 46 | * Plot Series |
---|
| 47 | * |
---|
| 48 | * @var array of PHPExcel_Chart_DataSeries |
---|
| 49 | */ |
---|
| 50 | private $_plotSeries = array(); |
---|
| 51 | |
---|
| 52 | /** |
---|
| 53 | * Create a new PHPExcel_Chart_PlotArea |
---|
| 54 | */ |
---|
| 55 | public function __construct(PHPExcel_Chart_Layout $layout = null, $plotSeries = array()) |
---|
| 56 | { |
---|
| 57 | $this->_layout = $layout; |
---|
| 58 | $this->_plotSeries = $plotSeries; |
---|
| 59 | } |
---|
| 60 | |
---|
| 61 | /** |
---|
| 62 | * Get Layout |
---|
| 63 | * |
---|
| 64 | * @return PHPExcel_Chart_Layout |
---|
| 65 | */ |
---|
| 66 | public function getLayout() { |
---|
| 67 | return $this->_layout; |
---|
| 68 | } |
---|
| 69 | |
---|
| 70 | /** |
---|
| 71 | * Get Number of Plot Groups |
---|
| 72 | * |
---|
| 73 | * @return array of PHPExcel_Chart_DataSeries |
---|
| 74 | */ |
---|
| 75 | public function getPlotGroupCount() { |
---|
| 76 | return count($this->_plotSeries); |
---|
| 77 | } |
---|
| 78 | |
---|
| 79 | /** |
---|
| 80 | * Get Number of Plot Series |
---|
| 81 | * |
---|
| 82 | * @return integer |
---|
| 83 | */ |
---|
| 84 | public function getPlotSeriesCount() { |
---|
| 85 | $seriesCount = 0; |
---|
| 86 | foreach($this->_plotSeries as $plot) { |
---|
| 87 | $seriesCount += $plot->getPlotSeriesCount(); |
---|
| 88 | } |
---|
| 89 | return $seriesCount; |
---|
| 90 | } |
---|
| 91 | |
---|
| 92 | /** |
---|
| 93 | * Get Plot Series |
---|
| 94 | * |
---|
| 95 | * @return array of PHPExcel_Chart_DataSeries |
---|
| 96 | */ |
---|
| 97 | public function getPlotGroup() { |
---|
| 98 | return $this->_plotSeries; |
---|
| 99 | } |
---|
| 100 | |
---|
| 101 | /** |
---|
| 102 | * Get Plot Series by Index |
---|
| 103 | * |
---|
| 104 | * @return PHPExcel_Chart_DataSeries |
---|
| 105 | */ |
---|
| 106 | public function getPlotGroupByIndex($index) { |
---|
| 107 | return $this->_plotSeries[$index]; |
---|
| 108 | } |
---|
| 109 | |
---|
| 110 | /** |
---|
| 111 | * Set Plot Series |
---|
| 112 | * |
---|
| 113 | * @param [PHPExcel_Chart_DataSeries] |
---|
| 114 | * @return PHPExcel_Chart_PlotArea |
---|
| 115 | */ |
---|
| 116 | public function setPlotSeries($plotSeries = array()) { |
---|
| 117 | $this->_plotSeries = $plotSeries; |
---|
| 118 | |
---|
| 119 | return $this; |
---|
| 120 | } |
---|
| 121 | |
---|
| 122 | public function refresh(PHPExcel_Worksheet $worksheet) { |
---|
| 123 | foreach($this->_plotSeries as $plotSeries) { |
---|
| 124 | $plotSeries->refresh($worksheet); |
---|
| 125 | } |
---|
| 126 | } |
---|
| 127 | |
---|
| 128 | } |
---|