2012-02-08 21:17:39 +00:00
|
|
|
<?php
|
2015-05-12 07:00:59 +00:00
|
|
|
|
2012-02-08 21:17:39 +00:00
|
|
|
/**
|
2015-05-12 07:00:59 +00:00
|
|
|
* PHPExcel_Chart_PlotArea
|
2012-02-08 21:17:39 +00:00
|
|
|
*
|
2015-05-02 22:50:37 +00:00
|
|
|
* Copyright (c) 2006 - 2015 PHPExcel
|
2012-02-08 21:17:39 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*
|
2015-05-12 07:00:59 +00:00
|
|
|
* @category PHPExcel
|
|
|
|
* @package PHPExcel_Chart
|
|
|
|
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
|
|
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
|
|
|
* @version ##VERSION##, ##DATE##
|
2012-02-08 21:17:39 +00:00
|
|
|
*/
|
|
|
|
class PHPExcel_Chart_PlotArea
|
|
|
|
{
|
2015-05-12 07:00:59 +00:00
|
|
|
/**
|
|
|
|
* PlotArea Layout
|
|
|
|
*
|
|
|
|
* @var PHPExcel_Chart_Layout
|
|
|
|
*/
|
2015-05-15 08:11:18 +00:00
|
|
|
private $layout = null;
|
2012-02-08 21:17:39 +00:00
|
|
|
|
2015-05-12 07:00:59 +00:00
|
|
|
/**
|
|
|
|
* Plot Series
|
|
|
|
*
|
|
|
|
* @var array of PHPExcel_Chart_DataSeries
|
|
|
|
*/
|
2015-05-15 08:11:18 +00:00
|
|
|
private $plotSeries = array();
|
2012-02-08 21:17:39 +00:00
|
|
|
|
2015-05-12 07:00:59 +00:00
|
|
|
/**
|
|
|
|
* Create a new PHPExcel_Chart_PlotArea
|
|
|
|
*/
|
|
|
|
public function __construct(PHPExcel_Chart_Layout $layout = null, $plotSeries = array())
|
|
|
|
{
|
2015-05-15 08:11:18 +00:00
|
|
|
$this->layout = $layout;
|
|
|
|
$this->plotSeries = $plotSeries;
|
2015-05-12 07:00:59 +00:00
|
|
|
}
|
2012-02-08 21:17:39 +00:00
|
|
|
|
2015-05-12 07:00:59 +00:00
|
|
|
/**
|
|
|
|
* Get Layout
|
|
|
|
*
|
|
|
|
* @return PHPExcel_Chart_Layout
|
|
|
|
*/
|
2015-05-12 11:17:41 +00:00
|
|
|
public function getLayout()
|
|
|
|
{
|
2015-05-15 08:11:18 +00:00
|
|
|
return $this->layout;
|
2015-05-12 07:00:59 +00:00
|
|
|
}
|
2012-02-08 21:17:39 +00:00
|
|
|
|
2015-05-12 07:00:59 +00:00
|
|
|
/**
|
|
|
|
* Get Number of Plot Groups
|
|
|
|
*
|
|
|
|
* @return array of PHPExcel_Chart_DataSeries
|
|
|
|
*/
|
2015-05-12 11:17:41 +00:00
|
|
|
public function getPlotGroupCount()
|
|
|
|
{
|
2015-05-15 08:11:18 +00:00
|
|
|
return count($this->plotSeries);
|
2015-05-12 07:00:59 +00:00
|
|
|
}
|
2012-02-08 21:17:39 +00:00
|
|
|
|
2015-05-12 07:00:59 +00:00
|
|
|
/**
|
|
|
|
* Get Number of Plot Series
|
|
|
|
*
|
|
|
|
* @return integer
|
|
|
|
*/
|
2015-05-12 11:17:41 +00:00
|
|
|
public function getPlotSeriesCount()
|
|
|
|
{
|
2015-05-12 07:00:59 +00:00
|
|
|
$seriesCount = 0;
|
2015-05-15 08:11:18 +00:00
|
|
|
foreach ($this->plotSeries as $plot) {
|
2015-05-12 07:00:59 +00:00
|
|
|
$seriesCount += $plot->getPlotSeriesCount();
|
|
|
|
}
|
|
|
|
return $seriesCount;
|
|
|
|
}
|
2012-02-08 21:17:39 +00:00
|
|
|
|
2015-05-12 07:00:59 +00:00
|
|
|
/**
|
|
|
|
* Get Plot Series
|
|
|
|
*
|
|
|
|
* @return array of PHPExcel_Chart_DataSeries
|
|
|
|
*/
|
2015-05-12 11:17:41 +00:00
|
|
|
public function getPlotGroup()
|
|
|
|
{
|
2015-05-15 08:11:18 +00:00
|
|
|
return $this->plotSeries;
|
2015-05-12 07:00:59 +00:00
|
|
|
}
|
2012-02-08 21:17:39 +00:00
|
|
|
|
2015-05-12 07:00:59 +00:00
|
|
|
/**
|
|
|
|
* Get Plot Series by Index
|
|
|
|
*
|
|
|
|
* @return PHPExcel_Chart_DataSeries
|
|
|
|
*/
|
2015-05-12 11:17:41 +00:00
|
|
|
public function getPlotGroupByIndex($index)
|
|
|
|
{
|
2015-05-15 08:11:18 +00:00
|
|
|
return $this->plotSeries[$index];
|
2015-05-12 07:00:59 +00:00
|
|
|
}
|
2012-02-08 21:17:39 +00:00
|
|
|
|
2015-05-12 07:00:59 +00:00
|
|
|
/**
|
|
|
|
* Set Plot Series
|
|
|
|
*
|
|
|
|
* @param [PHPExcel_Chart_DataSeries]
|
2013-12-30 23:44:42 +00:00
|
|
|
* @return PHPExcel_Chart_PlotArea
|
2015-05-12 07:00:59 +00:00
|
|
|
*/
|
2015-05-12 11:17:41 +00:00
|
|
|
public function setPlotSeries($plotSeries = array())
|
|
|
|
{
|
2015-05-15 08:11:18 +00:00
|
|
|
$this->plotSeries = $plotSeries;
|
2013-12-30 23:44:42 +00:00
|
|
|
|
|
|
|
return $this;
|
2015-05-12 07:00:59 +00:00
|
|
|
}
|
2012-02-08 21:17:39 +00:00
|
|
|
|
2015-05-12 11:17:41 +00:00
|
|
|
public function refresh(PHPExcel_Worksheet $worksheet)
|
|
|
|
{
|
2015-05-15 08:11:18 +00:00
|
|
|
foreach ($this->plotSeries as $plotSeries) {
|
2015-05-12 07:00:59 +00:00
|
|
|
$plotSeries->refresh($worksheet);
|
|
|
|
}
|
|
|
|
}
|
2012-02-08 21:17:39 +00:00
|
|
|
}
|