Documentation

Chart extends WriterPart

Table of Contents

CUSTOM_COLOR_TYPES  = [PhpOfficePhpSpreadsheetChartDataSeries::TYPE_BARCHART, PhpOfficePhpSpreadsheetChartDataSeries::TYPE_BARCHART_3D, PhpOfficePhpSpreadsheetChartDataSeries::TYPE_PIECHART, PhpOfficePhpSpreadsheetChartDataSeries::TYPE_PIECHART_3D, PhpOfficePhpSpreadsheetChartDataSeries::TYPE_DONUTCHART]
$parentWriter  : Xlsx
Parent Xlsx object.
$seriesIndex  : int
__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.
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 = [PhpOfficePhpSpreadsheetChartDataSeries::TYPE_BARCHART, PhpOfficePhpSpreadsheetChartDataSeries::TYPE_BARCHART_3D, PhpOfficePhpSpreadsheetChartDataSeries::TYPE_PIECHART, PhpOfficePhpSpreadsheetChartDataSeries::TYPE_PIECHART_3D, PhpOfficePhpSpreadsheetChartDataSeries::TYPE_DONUTCHART]

Properties

$seriesIndex

private int $seriesIndex

Methods

__construct()

Set parent Xlsx object.

public __construct(Xlsx $writer) : mixed
Parameters
$writer : Xlsx
Return values
mixed

getParentWriter()

Get parent Xlsx object.

public getParentWriter() : Xlsx
Return values
Xlsx

writeChart()

Write charts to XML format.

public writeChart(Chart $chart[, mixed $calculateCellValues = true ]) : string
Parameters
$chart : Chart
$calculateCellValues : mixed = 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
Return values
void

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
Return values
void

writeColor()

private writeColor(XMLWriter $objWriter, ChartColor $chartColor[, bool $solidFill = true ]) : void
Parameters
$objWriter : XMLWriter
$chartColor : ChartColor
$solidFill : bool = true
Return values
void

writeDataLabels()

Write Data Labels.

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

writeDataLabelsBool()

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

writeLayout()

Write Layout.

private writeLayout(XMLWriter $objWriter[, Layout|null $layout = null ]) : void
Parameters
$objWriter : XMLWriter
$layout : Layout|null = null
Return values
void

writeLegend()

Write Chart Legend.

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

writeLineStyles()

private writeLineStyles(XMLWriter $objWriter, Properties $gridlines[, bool $noFill = false ]) : void
Parameters
$objWriter : XMLWriter
$gridlines : Properties
$noFill : bool = false
Return values
void

writeNotEmpty()

private writeNotEmpty(XMLWriter $objWriter, string $name, string|null $value) : void
Parameters
$objWriter : XMLWriter
$name : string
$value : string|null
Return values
void

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
Return values
void

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

Return values
void

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

Return values
void

writePlotSeriesValuesElement()

Method writing plot series values.

private writePlotSeriesValuesElement(XMLWriter $objWriter, int $val, ChartColor|null $fillColor) : void
Parameters
$objWriter : XMLWriter
$val : int
$fillColor : ChartColor|null
Return values
void

writePrintSettings()

Write Printer Settings.

private writePrintSettings(XMLWriter $objWriter) : void
Parameters
$objWriter : XMLWriter
Return values
void

writeSerAxis()

Write Ser Axis, for Surface chart.

private writeSerAxis(XMLWriter $objWriter, string $id2, string $id3) : void
Parameters
$objWriter : XMLWriter
$id2 : string
$id3 : string
Return values
void

writeTitle()

Write Chart Title.

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

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
Return values
void

writeView3D()

private writeView3D(XMLWriter $objWriter, int|null $value, string $tag, bool $surface2D, int $default) : void
Parameters
$objWriter : XMLWriter
$value : int|null
$tag : string
$surface2D : bool
$default : int
Return values
void

Search results