Chart
extends WriterPart
in package
Table of Contents
Constants
- CUSTOM_COLOR_TYPES = [\PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_BARCHART, \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_BARCHART_3D, \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_PIECHART, \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_PIECHART_3D, \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_DONUTCHART]
Properties
- $parentWriter : Xlsx
- Parent Xlsx object.
- $seriesIndex : int
Methods
- __construct() : mixed
- Set parent Xlsx object.
- getParentWriter() : Xlsx
- Get parent Xlsx object.
- writeChart() : string
- Write charts to XML format.
- getChartType() : array<string|int, string>
- Get the data series type(s) for a chart plot series.
- writeAlternateContent() : void
- Write Alternate Content block.
- writeBubbles() : void
- Write Bubble Chart Details.
- writeCalculatedTitle() : bool
- Write Calculated Chart Title.
- writeCategoryAxis() : void
- Write Category Axis.
- writeColor() : void
- writeDataLabels() : void
- Write Data Labels.
- writeDataLabelsBool() : void
- writeEffects() : void
- writeGlow() : void
- writeLabelFont() : void
- writeLayout() : void
- Write Layout.
- writeLegend() : void
- Write Chart Legend.
- writeLineStyles() : void
- writeNotEmpty() : void
- writePlotArea() : void
- Write Chart Plot Area.
- writePlotGroup() : void
- Write Plot Group (series of related plots).
- writePlotSeriesLabel() : void
- Write Plot Series Label.
- writePlotSeriesValues() : void
- Write Plot Series Values.
- writePlotSeriesValuesElement() : void
- Method writing plot series values.
- writePrintSettings() : void
- Write Printer Settings.
- writeSerAxis() : void
- Write Ser Axis, for Surface chart.
- writeShadow() : void
- writeSoftEdge() : void
- writeTitle() : void
- Write Chart Title.
- writeValueAxis() : void
- Write Value Axis.
- writeView3D() : void
Constants
CUSTOM_COLOR_TYPES
private
mixed
CUSTOM_COLOR_TYPES
= [\PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_BARCHART, \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_BARCHART_3D, \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_PIECHART, \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_PIECHART_3D, \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_DONUTCHART]
Properties
$parentWriter
Parent Xlsx object.
private
Xlsx
$parentWriter
$seriesIndex
private
int
$seriesIndex
Methods
__construct()
Set parent Xlsx object.
public
__construct(Xlsx $writer) : mixed
Parameters
- $writer : Xlsx
getParentWriter()
Get parent Xlsx object.
public
getParentWriter() : Xlsx
Return values
XlsxwriteChart()
Write charts to XML format.
public
writeChart(Chart $chart[, bool $calculateCellValues = true ]) : string
Parameters
- $chart : Chart
- $calculateCellValues : bool = true
Return values
string —XML Output
getChartType()
Get the data series type(s) for a chart plot series.
private
static getChartType(PlotArea $plotArea) : array<string|int, string>
Parameters
- $plotArea : PlotArea
Return values
array<string|int, string>writeAlternateContent()
Write Alternate Content block.
private
writeAlternateContent(XMLWriter $objWriter) : void
Parameters
- $objWriter : XMLWriter
writeBubbles()
Write Bubble Chart Details.
private
writeBubbles(DataSeriesValues|null $plotSeriesValues, XMLWriter $objWriter) : void
Parameters
- $plotSeriesValues : DataSeriesValues|null
- $objWriter : XMLWriter
writeCalculatedTitle()
Write Calculated Chart Title.
private
writeCalculatedTitle(XMLWriter $objWriter, Title $title) : bool
Parameters
Return values
boolwriteCategoryAxis()
Write Category Axis.
private
writeCategoryAxis(XMLWriter $objWriter, Title|null $xAxisLabel, string $id1, string $id2, bool $isMultiLevelSeries, Axis $yAxis) : void
Parameters
writeColor()
private
writeColor(XMLWriter $objWriter, ChartColor $chartColor[, bool $solidFill = true ]) : void
Parameters
- $objWriter : XMLWriter
- $chartColor : ChartColor
- $solidFill : bool = true
writeDataLabels()
Write Data Labels.
private
writeDataLabels(XMLWriter $objWriter[, Layout|null $chartLayout = null ]) : void
Parameters
writeDataLabelsBool()
private
writeDataLabelsBool(XMLWriter $objWriter, string $name, bool|null $value) : void
Parameters
- $objWriter : XMLWriter
- $name : string
- $value : bool|null
writeEffects()
private
writeEffects(XMLWriter $objWriter, Properties $yAxis) : void
Parameters
- $objWriter : XMLWriter
- $yAxis : Properties
writeGlow()
private
writeGlow(XMLWriter $objWriter, Properties $yAxis) : void
Parameters
- $objWriter : XMLWriter
- $yAxis : Properties
writeLabelFont()
private
writeLabelFont(XMLWriter $objWriter, Font|null $labelFont, Properties|null $axisText) : void
Parameters
- $objWriter : XMLWriter
- $labelFont : Font|null
- $axisText : Properties|null
writeLayout()
Write Layout.
private
writeLayout(XMLWriter $objWriter[, Layout|null $layout = null ]) : void
Parameters
writeLegend()
Write Chart Legend.
private
writeLegend(XMLWriter $objWriter[, Legend|null $legend = null ]) : void
Parameters
writeLineStyles()
private
writeLineStyles(XMLWriter $objWriter, Properties $gridlines[, bool $noFill = false ]) : void
Parameters
- $objWriter : XMLWriter
- $gridlines : Properties
- $noFill : bool = false
writeNotEmpty()
private
writeNotEmpty(XMLWriter $objWriter, string $name, string|null $value) : void
Parameters
- $objWriter : XMLWriter
- $name : string
- $value : string|null
writePlotArea()
Write Chart Plot Area.
private
writePlotArea(XMLWriter $objWriter, PlotArea|null $plotArea[, Title|null $xAxisLabel = null ][, Title|null $yAxisLabel = null ][, Axis|null $xAxis = null ][, Axis|null $yAxis = null ]) : void
Parameters
writePlotGroup()
Write Plot Group (series of related plots).
private
writePlotGroup(DataSeries|null $plotGroup, string $groupType, XMLWriter $objWriter, bool &$catIsMultiLevelSeries, bool &$valIsMultiLevelSeries, string &$plotGroupingType) : void
Parameters
- $plotGroup : DataSeries|null
- $groupType : string
-
Type of plot for dataseries
- $objWriter : XMLWriter
- $catIsMultiLevelSeries : bool
-
Is category a multi-series category
- $valIsMultiLevelSeries : bool
-
Is value set a multi-series set
- $plotGroupingType : string
-
Type of grouping for multi-series values
writePlotSeriesLabel()
Write Plot Series Label.
private
writePlotSeriesLabel(DataSeriesValues|null $plotSeriesLabel, XMLWriter $objWriter) : void
Parameters
- $plotSeriesLabel : DataSeriesValues|null
- $objWriter : XMLWriter
writePlotSeriesValues()
Write Plot Series Values.
private
writePlotSeriesValues(DataSeriesValues|null $plotSeriesValues, XMLWriter $objWriter, string $groupType[, string $dataType = 'str' ]) : void
Parameters
- $plotSeriesValues : DataSeriesValues|null
- $objWriter : XMLWriter
- $groupType : string
-
Type of plot for dataseries
- $dataType : string = 'str'
-
Datatype of series values
writePlotSeriesValuesElement()
Method writing plot series values.
private
writePlotSeriesValuesElement(XMLWriter $objWriter, int $val, ChartColor|null $fillColor) : void
Parameters
- $objWriter : XMLWriter
- $val : int
- $fillColor : ChartColor|null
writePrintSettings()
Write Printer Settings.
private
writePrintSettings(XMLWriter $objWriter) : void
Parameters
- $objWriter : XMLWriter
writeSerAxis()
Write Ser Axis, for Surface chart.
private
writeSerAxis(XMLWriter $objWriter, string $id2, string $id3) : void
Parameters
- $objWriter : XMLWriter
- $id2 : string
- $id3 : string
writeShadow()
private
writeShadow(XMLWriter $objWriter, Properties $xAxis) : void
Parameters
- $objWriter : XMLWriter
- $xAxis : Properties
writeSoftEdge()
private
writeSoftEdge(XMLWriter $objWriter, Properties $yAxis) : void
Parameters
- $objWriter : XMLWriter
- $yAxis : Properties
writeTitle()
Write Chart Title.
private
writeTitle(XMLWriter $objWriter[, Title|null $title = null ]) : void
Parameters
writeValueAxis()
Write Value Axis.
private
writeValueAxis(XMLWriter $objWriter, Title|null $yAxisLabel, null|string $groupType, string $id1, string $id2, bool $isMultiLevelSeries, Axis $xAxis) : void
Parameters
writeView3D()
private
writeView3D(XMLWriter $objWriter, int|null $value, string $tag, bool $surface2D[, int $default = 0 ]) : void
Parameters
- $objWriter : XMLWriter
- $value : int|null
- $tag : string
- $surface2D : bool
- $default : int = 0