ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PhpOffice\PhpSpreadsheet\Chart\DataSeries Class Reference
+ Collaboration diagram for PhpOffice\PhpSpreadsheet\Chart\DataSeries:

Public Member Functions

 __construct ($plotType=null, $plotGrouping=null, array $plotOrder=[], array $plotLabel=[], array $plotCategory=[], array $plotValues=[], $plotDirection=null, $smoothLine=false, $plotStyle=null)
 Create a new DataSeries. More...
 
 getPlotType ()
 Get Plot Type. More...
 
 setPlotType ($plotType)
 Set Plot Type. More...
 
 getPlotGrouping ()
 Get Plot Grouping Type. More...
 
 setPlotGrouping ($groupingType)
 Set Plot Grouping Type. More...
 
 getPlotDirection ()
 Get Plot Direction. More...
 
 setPlotDirection ($plotDirection)
 Set Plot Direction. More...
 
 getPlotOrder ()
 Get Plot Order. More...
 
 getPlotLabels ()
 Get Plot Labels. More...
 
 getPlotLabelByIndex ($index)
 Get Plot Label by Index. More...
 
 getPlotCategories ()
 Get Plot Categories. More...
 
 getPlotCategoryByIndex ($index)
 Get Plot Category by Index. More...
 
 getPlotStyle ()
 Get Plot Style. More...
 
 setPlotStyle ($plotStyle)
 Set Plot Style. More...
 
 getPlotValues ()
 Get Plot Values. More...
 
 getPlotValuesByIndex ($index)
 Get Plot Values by Index. More...
 
 getPlotSeriesCount ()
 Get Number of Plot Series. More...
 
 getSmoothLine ()
 Get Smooth Line. More...
 
 setSmoothLine ($smoothLine)
 Set Smooth Line. More...
 
 refresh (Worksheet $worksheet)
 

Data Fields

const TYPE_BARCHART = 'barChart'
 
const TYPE_BARCHART_3D = 'bar3DChart'
 
const TYPE_LINECHART = 'lineChart'
 
const TYPE_LINECHART_3D = 'line3DChart'
 
const TYPE_AREACHART = 'areaChart'
 
const TYPE_AREACHART_3D = 'area3DChart'
 
const TYPE_PIECHART = 'pieChart'
 
const TYPE_PIECHART_3D = 'pie3DChart'
 
const TYPE_DOUGHNUTCHART = 'doughnutChart'
 
const TYPE_DONUTCHART = self::TYPE_DOUGHNUTCHART
 
const TYPE_SCATTERCHART = 'scatterChart'
 
const TYPE_SURFACECHART = 'surfaceChart'
 
const TYPE_SURFACECHART_3D = 'surface3DChart'
 
const TYPE_RADARCHART = 'radarChart'
 
const TYPE_BUBBLECHART = 'bubbleChart'
 
const TYPE_STOCKCHART = 'stockChart'
 
const TYPE_CANDLECHART = self::TYPE_STOCKCHART
 
const GROUPING_CLUSTERED = 'clustered'
 
const GROUPING_STACKED = 'stacked'
 
const GROUPING_PERCENT_STACKED = 'percentStacked'
 
const GROUPING_STANDARD = 'standard'
 
const DIRECTION_BAR = 'bar'
 
const DIRECTION_HORIZONTAL = self::DIRECTION_BAR
 
const DIRECTION_COL = 'col'
 
const DIRECTION_COLUMN = self::DIRECTION_COL
 
const DIRECTION_VERTICAL = self::DIRECTION_COL
 
const STYLE_LINEMARKER = 'lineMarker'
 
const STYLE_SMOOTHMARKER = 'smoothMarker'
 
const STYLE_MARKER = 'marker'
 
const STYLE_FILLED = 'filled'
 
const EMPTY_AS_GAP = 'gap'
 
const EMPTY_AS_ZERO = 'zero'
 
const EMPTY_AS_SPAN = 'span'
 

Private Attributes

 $plotType
 
 $plotGrouping
 
 $plotDirection
 
 $plotStyle
 
 $plotOrder = []
 
 $plotLabel = []
 
 $plotCategory = []
 
 $smoothLine
 
 $plotValues = []
 

Detailed Description

Definition at line 7 of file DataSeries.php.

Constructor & Destructor Documentation

◆ __construct()

PhpOffice\PhpSpreadsheet\Chart\DataSeries::__construct (   $plotType = null,
  $plotGrouping = null,
array  $plotOrder = [],
array  $plotLabel = [],
array  $plotCategory = [],
array  $plotValues = [],
  $plotDirection = null,
  $smoothLine = false,
  $plotStyle = null 
)

Create a new DataSeries.

Parameters
null | mixed$plotType
null | mixed$plotGrouping
int[]$plotOrder
DataSeriesValues[]$plotLabel
DataSeriesValues[]$plotCategory
DataSeriesValues[]$plotValues
null | string$plotDirection
bool$smoothLine
null | string$plotStyle

Definition at line 123 of file DataSeries.php.

References $keys, PhpOffice\PhpSpreadsheet\Chart\DataSeries\$plotCategory, PhpOffice\PhpSpreadsheet\Chart\DataSeries\$plotDirection, PhpOffice\PhpSpreadsheet\Chart\DataSeries\$plotGrouping, PhpOffice\PhpSpreadsheet\Chart\DataSeries\$plotLabel, PhpOffice\PhpSpreadsheet\Chart\DataSeries\$plotOrder, PhpOffice\PhpSpreadsheet\Chart\DataSeries\$plotStyle, PhpOffice\PhpSpreadsheet\Chart\DataSeries\$plotType, PhpOffice\PhpSpreadsheet\Chart\DataSeries\$plotValues, and PhpOffice\PhpSpreadsheet\Chart\DataSeries\$smoothLine.

124  {
125  $this->plotType = $plotType;
126  $this->plotGrouping = $plotGrouping;
127  $this->plotOrder = $plotOrder;
128  $keys = array_keys($plotValues);
129  $this->plotValues = $plotValues;
130  if ((count($plotLabel) == 0) || ($plotLabel[$keys[0]] === null)) {
131  $plotLabel[$keys[0]] = new DataSeriesValues();
132  }
133  $this->plotLabel = $plotLabel;
134 
135  if ((count($plotCategory) == 0) || ($plotCategory[$keys[0]] === null)) {
136  $plotCategory[$keys[0]] = new DataSeriesValues();
137  }
138  $this->plotCategory = $plotCategory;
139 
140  $this->smoothLine = $smoothLine;
141  $this->plotStyle = $plotStyle;
142 
143  if ($plotDirection === null) {
144  $plotDirection = self::DIRECTION_COL;
145  }
146  $this->plotDirection = $plotDirection;
147  }
$keys

Member Function Documentation

◆ getPlotCategories()

PhpOffice\PhpSpreadsheet\Chart\DataSeries::getPlotCategories ( )

Get Plot Categories.

Returns
DataSeriesValues[]

Definition at line 265 of file DataSeries.php.

References PhpOffice\PhpSpreadsheet\Chart\DataSeries\$plotCategory.

◆ getPlotCategoryByIndex()

PhpOffice\PhpSpreadsheet\Chart\DataSeries::getPlotCategoryByIndex (   $index)

Get Plot Category by Index.

Parameters
mixed$index
Returns
DataSeriesValues|false

Definition at line 277 of file DataSeries.php.

References $index, and $keys.

278  {
279  $keys = array_keys($this->plotCategory);
280  if (in_array($index, $keys)) {
281  return $this->plotCategory[$index];
282  } elseif (isset($keys[$index])) {
283  return $this->plotCategory[$keys[$index]];
284  }
285 
286  return false;
287  }
$index
Definition: metadata.php:60
$keys

◆ getPlotDirection()

PhpOffice\PhpSpreadsheet\Chart\DataSeries::getPlotDirection ( )

Get Plot Direction.

Returns
string

Definition at line 202 of file DataSeries.php.

References PhpOffice\PhpSpreadsheet\Chart\DataSeries\$plotDirection.

◆ getPlotGrouping()

PhpOffice\PhpSpreadsheet\Chart\DataSeries::getPlotGrouping ( )

Get Plot Grouping Type.

Returns
string

Definition at line 178 of file DataSeries.php.

References PhpOffice\PhpSpreadsheet\Chart\DataSeries\$plotGrouping.

◆ getPlotLabelByIndex()

PhpOffice\PhpSpreadsheet\Chart\DataSeries::getPlotLabelByIndex (   $index)

Get Plot Label by Index.

Parameters
mixed$index
Returns
DataSeriesValues|false

Definition at line 248 of file DataSeries.php.

References $index, and $keys.

249  {
250  $keys = array_keys($this->plotLabel);
251  if (in_array($index, $keys)) {
252  return $this->plotLabel[$index];
253  } elseif (isset($keys[$index])) {
254  return $this->plotLabel[$keys[$index]];
255  }
256 
257  return false;
258  }
$index
Definition: metadata.php:60
$keys

◆ getPlotLabels()

PhpOffice\PhpSpreadsheet\Chart\DataSeries::getPlotLabels ( )

Get Plot Labels.

Returns
DataSeriesValues[]

Definition at line 236 of file DataSeries.php.

References PhpOffice\PhpSpreadsheet\Chart\DataSeries\$plotLabel.

◆ getPlotOrder()

PhpOffice\PhpSpreadsheet\Chart\DataSeries::getPlotOrder ( )

Get Plot Order.

Returns
int[]

Definition at line 226 of file DataSeries.php.

References PhpOffice\PhpSpreadsheet\Chart\DataSeries\$plotOrder.

◆ getPlotSeriesCount()

PhpOffice\PhpSpreadsheet\Chart\DataSeries::getPlotSeriesCount ( )

Get Number of Plot Series.

Returns
int

Definition at line 347 of file DataSeries.php.

348  {
349  return count($this->plotValues);
350  }

◆ getPlotStyle()

PhpOffice\PhpSpreadsheet\Chart\DataSeries::getPlotStyle ( )

Get Plot Style.

Returns
null|string

Definition at line 294 of file DataSeries.php.

References PhpOffice\PhpSpreadsheet\Chart\DataSeries\$plotStyle.

◆ getPlotType()

PhpOffice\PhpSpreadsheet\Chart\DataSeries::getPlotType ( )

Get Plot Type.

Returns
string

Definition at line 154 of file DataSeries.php.

References PhpOffice\PhpSpreadsheet\Chart\DataSeries\$plotType.

◆ getPlotValues()

PhpOffice\PhpSpreadsheet\Chart\DataSeries::getPlotValues ( )

Get Plot Values.

Returns
DataSeriesValues[]

Definition at line 318 of file DataSeries.php.

References PhpOffice\PhpSpreadsheet\Chart\DataSeries\$plotValues.

◆ getPlotValuesByIndex()

PhpOffice\PhpSpreadsheet\Chart\DataSeries::getPlotValuesByIndex (   $index)

Get Plot Values by Index.

Parameters
mixed$index
Returns
DataSeriesValues|false

Definition at line 330 of file DataSeries.php.

References $index, and $keys.

331  {
332  $keys = array_keys($this->plotValues);
333  if (in_array($index, $keys)) {
334  return $this->plotValues[$index];
335  } elseif (isset($keys[$index])) {
336  return $this->plotValues[$keys[$index]];
337  }
338 
339  return false;
340  }
$index
Definition: metadata.php:60
$keys

◆ getSmoothLine()

PhpOffice\PhpSpreadsheet\Chart\DataSeries::getSmoothLine ( )

Get Smooth Line.

Returns
bool

Definition at line 357 of file DataSeries.php.

References PhpOffice\PhpSpreadsheet\Chart\DataSeries\$smoothLine.

◆ refresh()

PhpOffice\PhpSpreadsheet\Chart\DataSeries::refresh ( Worksheet  $worksheet)

Definition at line 376 of file DataSeries.php.

References PhpOffice\PhpSpreadsheet\Chart\DataSeries\$plotValues.

376  : void
377  {
378  foreach ($this->plotValues as $plotValues) {
379  if ($plotValues !== null) {
380  $plotValues->refresh($worksheet, true);
381  }
382  }
383  foreach ($this->plotLabel as $plotValues) {
384  if ($plotValues !== null) {
385  $plotValues->refresh($worksheet, true);
386  }
387  }
388  foreach ($this->plotCategory as $plotValues) {
389  if ($plotValues !== null) {
390  $plotValues->refresh($worksheet, false);
391  }
392  }
393  }

◆ setPlotDirection()

PhpOffice\PhpSpreadsheet\Chart\DataSeries::setPlotDirection (   $plotDirection)

Set Plot Direction.

Parameters
string$plotDirection
Returns
$this

Definition at line 214 of file DataSeries.php.

References PhpOffice\PhpSpreadsheet\Chart\DataSeries\$plotDirection.

215  {
216  $this->plotDirection = $plotDirection;
217 
218  return $this;
219  }

◆ setPlotGrouping()

PhpOffice\PhpSpreadsheet\Chart\DataSeries::setPlotGrouping (   $groupingType)

Set Plot Grouping Type.

Parameters
string$groupingType
Returns
$this

Definition at line 190 of file DataSeries.php.

191  {
192  $this->plotGrouping = $groupingType;
193 
194  return $this;
195  }

◆ setPlotStyle()

PhpOffice\PhpSpreadsheet\Chart\DataSeries::setPlotStyle (   $plotStyle)

Set Plot Style.

Parameters
null | string$plotStyle
Returns
$this

Definition at line 306 of file DataSeries.php.

References PhpOffice\PhpSpreadsheet\Chart\DataSeries\$plotStyle.

307  {
308  $this->plotStyle = $plotStyle;
309 
310  return $this;
311  }

◆ setPlotType()

PhpOffice\PhpSpreadsheet\Chart\DataSeries::setPlotType (   $plotType)

Set Plot Type.

Parameters
string$plotType
Returns
$this

Definition at line 166 of file DataSeries.php.

References PhpOffice\PhpSpreadsheet\Chart\DataSeries\$plotType.

167  {
168  $this->plotType = $plotType;
169 
170  return $this;
171  }

◆ setSmoothLine()

PhpOffice\PhpSpreadsheet\Chart\DataSeries::setSmoothLine (   $smoothLine)

Set Smooth Line.

Parameters
bool$smoothLine
Returns
$this

Definition at line 369 of file DataSeries.php.

References PhpOffice\PhpSpreadsheet\Chart\DataSeries\$smoothLine.

370  {
371  $this->smoothLine = $smoothLine;
372 
373  return $this;
374  }

Field Documentation

◆ $plotCategory

PhpOffice\PhpSpreadsheet\Chart\DataSeries::$plotCategory = []
private

◆ $plotDirection

◆ $plotGrouping

PhpOffice\PhpSpreadsheet\Chart\DataSeries::$plotGrouping
private

◆ $plotLabel

PhpOffice\PhpSpreadsheet\Chart\DataSeries::$plotLabel = []
private

◆ $plotOrder

PhpOffice\PhpSpreadsheet\Chart\DataSeries::$plotOrder = []
private

◆ $plotStyle

◆ $plotType

◆ $plotValues

PhpOffice\PhpSpreadsheet\Chart\DataSeries::$plotValues = []
private

◆ $smoothLine

◆ DIRECTION_BAR

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::DIRECTION_BAR = 'bar'

Definition at line 32 of file DataSeries.php.

◆ DIRECTION_COL

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::DIRECTION_COL = 'col'

Definition at line 34 of file DataSeries.php.

◆ DIRECTION_COLUMN

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::DIRECTION_COLUMN = self::DIRECTION_COL

Definition at line 35 of file DataSeries.php.

◆ DIRECTION_HORIZONTAL

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::DIRECTION_HORIZONTAL = self::DIRECTION_BAR

Definition at line 33 of file DataSeries.php.

◆ DIRECTION_VERTICAL

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::DIRECTION_VERTICAL = self::DIRECTION_COL

Definition at line 36 of file DataSeries.php.

◆ EMPTY_AS_GAP

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::EMPTY_AS_GAP = 'gap'

Definition at line 43 of file DataSeries.php.

◆ EMPTY_AS_SPAN

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::EMPTY_AS_SPAN = 'span'

Definition at line 45 of file DataSeries.php.

◆ EMPTY_AS_ZERO

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::EMPTY_AS_ZERO = 'zero'

Definition at line 44 of file DataSeries.php.

◆ GROUPING_CLUSTERED

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::GROUPING_CLUSTERED = 'clustered'

Definition at line 27 of file DataSeries.php.

◆ GROUPING_PERCENT_STACKED

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::GROUPING_PERCENT_STACKED = 'percentStacked'

Definition at line 29 of file DataSeries.php.

◆ GROUPING_STACKED

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::GROUPING_STACKED = 'stacked'

Definition at line 28 of file DataSeries.php.

◆ GROUPING_STANDARD

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::GROUPING_STANDARD = 'standard'

Definition at line 30 of file DataSeries.php.

◆ STYLE_FILLED

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::STYLE_FILLED = 'filled'

Definition at line 41 of file DataSeries.php.

◆ STYLE_LINEMARKER

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::STYLE_LINEMARKER = 'lineMarker'

Definition at line 38 of file DataSeries.php.

◆ STYLE_MARKER

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::STYLE_MARKER = 'marker'

Definition at line 40 of file DataSeries.php.

◆ STYLE_SMOOTHMARKER

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::STYLE_SMOOTHMARKER = 'smoothMarker'

Definition at line 39 of file DataSeries.php.

◆ TYPE_AREACHART

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_AREACHART = 'areaChart'

Definition at line 13 of file DataSeries.php.

◆ TYPE_AREACHART_3D

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_AREACHART_3D = 'area3DChart'

Definition at line 14 of file DataSeries.php.

◆ TYPE_BARCHART

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_BARCHART = 'barChart'

Definition at line 9 of file DataSeries.php.

◆ TYPE_BARCHART_3D

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_BARCHART_3D = 'bar3DChart'

Definition at line 10 of file DataSeries.php.

◆ TYPE_BUBBLECHART

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_BUBBLECHART = 'bubbleChart'

Definition at line 23 of file DataSeries.php.

◆ TYPE_CANDLECHART

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_CANDLECHART = self::TYPE_STOCKCHART

Definition at line 25 of file DataSeries.php.

◆ TYPE_DONUTCHART

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_DONUTCHART = self::TYPE_DOUGHNUTCHART

Definition at line 18 of file DataSeries.php.

◆ TYPE_DOUGHNUTCHART

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_DOUGHNUTCHART = 'doughnutChart'

Definition at line 17 of file DataSeries.php.

◆ TYPE_LINECHART

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_LINECHART = 'lineChart'

Definition at line 11 of file DataSeries.php.

◆ TYPE_LINECHART_3D

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_LINECHART_3D = 'line3DChart'

Definition at line 12 of file DataSeries.php.

◆ TYPE_PIECHART

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_PIECHART = 'pieChart'

Definition at line 15 of file DataSeries.php.

◆ TYPE_PIECHART_3D

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_PIECHART_3D = 'pie3DChart'

Definition at line 16 of file DataSeries.php.

◆ TYPE_RADARCHART

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_RADARCHART = 'radarChart'

Definition at line 22 of file DataSeries.php.

◆ TYPE_SCATTERCHART

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_SCATTERCHART = 'scatterChart'

Definition at line 19 of file DataSeries.php.

◆ TYPE_STOCKCHART

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_STOCKCHART = 'stockChart'

Definition at line 24 of file DataSeries.php.

◆ TYPE_SURFACECHART

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_SURFACECHART = 'surfaceChart'

Definition at line 20 of file DataSeries.php.

◆ TYPE_SURFACECHART_3D

const PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_SURFACECHART_3D = 'surface3DChart'

Definition at line 21 of file DataSeries.php.


The documentation for this class was generated from the following file: