Documentation

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

$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
Xlsx

writeChart()

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

writeCalculatedTitle()

Write Calculated Chart Title.

private writeCalculatedTitle(XMLWriter $objWriter, Title $title) : bool
Parameters
$objWriter : XMLWriter
$title : Title
Return values
bool

writeCategoryAxis()

Write Category Axis.

private writeCategoryAxis(XMLWriter $objWriter, Title|null $xAxisLabel, string $id1, string $id2, bool $isMultiLevelSeries, Axis $yAxis) : void
Parameters
$objWriter : XMLWriter
$xAxisLabel : Title|null
$id1 : string
$id2 : string
$isMultiLevelSeries : bool
$yAxis : Axis

writeDataLabels()

Write Data Labels.

private writeDataLabels(XMLWriter $objWriter[, Layout|null $chartLayout = null ]) : void
Parameters
$objWriter : XMLWriter
$chartLayout : Layout|null = null

writeDataLabelsBool()

private writeDataLabelsBool(XMLWriter $objWriter, string $name, bool|null $value) : void
Parameters
$objWriter : XMLWriter
$name : string
$value : bool|null

writeLegend()

Write Chart Legend.

private writeLegend(XMLWriter $objWriter[, Legend|null $legend = null ]) : void
Parameters
$objWriter : XMLWriter
$legend : Legend|null = null

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
$objWriter : XMLWriter
$plotArea : PlotArea|null
$xAxisLabel : Title|null = null
$yAxisLabel : Title|null = null
$xAxis : Axis|null = null
$yAxis : Axis|null = null

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

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

writeTitle()

Write Chart Title.

private writeTitle(XMLWriter $objWriter[, Title|null $title = null ]) : void
Parameters
$objWriter : XMLWriter
$title : Title|null = null

writeValueAxis()

Write Value Axis.

private writeValueAxis(XMLWriter $objWriter, Title|null $yAxisLabel, null|string $groupType, string $id1, string $id2, bool $isMultiLevelSeries, Axis $xAxis) : void
Parameters
$objWriter : XMLWriter
$yAxisLabel : Title|null
$groupType : null|string

Chart type

$id1 : string
$id2 : string
$isMultiLevelSeries : bool
$xAxis : Axis

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

        
On this page

Search results