43 self::DATASERIES_TYPE_STRING,
44 self::DATASERIES_TYPE_NUMBER,
92 public function __construct($dataType = self::DATASERIES_TYPE_NUMBER, $dataSource = null, $formatCode = null, $pointCount = 0, $dataValues =
array(), $marker = null)
95 $this->_dataSource = $dataSource;
96 $this->_formatCode = $formatCode;
97 $this->_pointCount = $pointCount;
98 $this->_dataValues = $dataValues;
99 $this->_marker = $marker;
122 public function setDataType($dataType = self::DATASERIES_TYPE_NUMBER) {
123 if (!in_array($dataType, self::$_dataTypeValues)) {
126 $this->_dataType = $dataType;
146 public function setDataSource($dataSource = null, $refreshDataValues =
true) {
147 $this->_dataSource = $dataSource;
149 if ($refreshDataValues) {
172 $this->_marker = $marker;
193 $this->_formatCode = $formatCode;
213 if (count($this->_dataValues) > 0) {
214 return is_array($this->_dataValues[0]);
226 foreach($this->_dataValues as $dataValueSet) {
227 $levelCount = max($levelCount,count($dataValueSet));
247 $count = count($this->_dataValues);
250 } elseif ($count == 1) {
251 return $this->_dataValues[0];
267 $this->_pointCount = count($dataValues);
269 if ($refreshDataSource) {
277 return $var !== NULL;
281 if ($this->_dataSource !== NULL) {
284 $calcEngine->_calculateFormulaValue(
285 '='.$this->_dataSource,
292 foreach($this->_dataValues as &$dataValue) {
293 if ((!empty($dataValue)) && ($dataValue[0] ==
'#')) {
299 $cellRange = explode(
'!',$this->_dataSource);
300 if (count($cellRange) > 1) {
301 list(,$cellRange) = $cellRange;
305 if (($dimensions[0] == 1) || ($dimensions[1] == 1)) {
308 $newArray = array_values(array_shift($newDataValues));
309 foreach($newArray as
$i => $newDataSet) {
310 $newArray[
$i] =
array($newDataSet);
313 foreach($newDataValues as $newDataSet) {
315 foreach($newDataSet as $newDataVal) {
316 array_unshift($newArray[
$i++],$newDataVal);
319 $this->_dataValues = $newArray;
322 $this->_pointCount = count($this->_dataValues);
setPointMarker($marker=null)
Set Point Marker.
setDataValues($dataValues=array(), $refreshDataSource=TRUE)
Set Series Data Values.
refresh(PHPExcel_Worksheet $worksheet, $flatten=TRUE)
getDataSource()
Get Series Data Source (formula)
getDataValue()
Get the first Series Data value.
getDataType()
Get Series Data Type.
isMultiLevelSeries()
Identify if the Data Series is a multi-level or a simple series.
static rangeDimension($pRange='A1:A1')
Calculate range dimension.
const DATASERIES_TYPE_STRING
static flattenArray($array)
Convert a multi-dimensional array to a simple 1-dimensional array.
getFormatCode()
Get Series Format Code.
getCell($pCoordinate='A1')
Get cell at a specific coordinate.
setDataType($dataType=self::DATASERIES_TYPE_NUMBER)
Set Series Data Type.
setFormatCode($formatCode=null)
Set Series Format Code.
__construct($dataType=self::DATASERIES_TYPE_NUMBER, $dataSource=null, $formatCode=null, $pointCount=0, $dataValues=array(), $marker=null)
Create a new PHPExcel_Chart_DataSeriesValues object.
Create styles array
The data for the language used.
multiLevelCount()
Return the level count of a multi-level Data Series.
getDataValues()
Get Series Data Values.
getPointCount()
Get Series Point Count.
static getInstance(PHPExcel $workbook=NULL)
Get an instance of this class.
static _unwrapResult($value)
Remove quotes used as a wrapper to identify string values.
const DATASERIES_TYPE_NUMBER
setDataSource($dataSource=null, $refreshDataValues=true)
Set Series Data Source (formula)
getPointMarker()
Get Point Marker.