Chart
Table of Contents
- $autoTitleDeleted : bool
- $borderLines : GridLines
- $bottomRightCellRef : string
- Bottom-Right Cell Position.
- $bottomRightXOffset : int
- Bottom-Right X-Offset.
- $bottomRightYOffset : int
- Bottom-Right Y-Offset.
- $displayBlanksAs : string
- Display Blanks as.
- $fillColor : ChartColor
- $legend : Legend|null
- Chart Legend.
- $name : string
- Chart Name.
- $noFill : bool
- $oneCellAnchor : bool
- $perspective : int|null
- $plotArea : PlotArea|null
- Chart Plot Area.
- $plotVisibleOnly : bool
- Plot Visible Only.
- $rAngAx : int|null
- $rotX : int|null
- $rotY : int|null
- $roundedCorners : bool
- $title : Title|null
- Chart Title.
- $topLeftCellRef : string
- Top-Left Cell Position.
- $topLeftXOffset : int
- Top-Left X-Offset.
- $topLeftYOffset : int
- Top-Left Y-Offset.
- $worksheet : Worksheet|null
- Worksheet.
- $xAxis : Axis
- Chart Asix X as.
- $xAxisLabel : Title|null
- X-Axis Label.
- $yAxis : Axis
- Chart Asix Y as.
- $yAxisLabel : Title|null
- Y-Axis Label.
- __construct() : mixed
- Create a new Chart.
- getAutoTitleDeleted() : bool
- getBorderLines() : GridLines
- getBottomRightCell() : string
- Get the cell address where the bottom right of the chart is fixed.
- getBottomRightOffset() : array<string|int, int>
- Get the offset position within the Bottom Right cell for the chart.
- getBottomRightPosition() : array<string|int, mixed>
- Get the bottom right position of the chart.
- getBottomRightXOffset() : int
- getBottomRightYOffset() : int
- getChartAxisX() : Axis
- getChartAxisY() : Axis
- getDisplayBlanksAs() : string
- Get Display Blanks as.
- getFillColor() : ChartColor
- getLegend() : Legend|null
- getMajorGridlines() : GridLines|null
- Get Major Gridlines.
- getMinorGridlines() : GridLines|null
- Get Minor Gridlines.
- getName() : string
- Get Name.
- getNoFill() : bool
- getOneCellAnchor() : bool
- getPerspective() : int|null
- getPlotArea() : PlotArea|null
- getPlotVisibleOnly() : bool
- Get Plot Visible Only.
- getRAngAx() : int|null
- getRotX() : int|null
- getRotY() : int|null
- getRoundedCorners() : bool
- getTitle() : Title|null
- getTopLeftCell() : string
- Get the cell address where the top left of the chart is fixed.
- getTopLeftOffset() : array<string|int, int>
- Get the offset position within the Top Left cell for the chart.
- getTopLeftPosition() : array<string|int, mixed>
- Get the top left position of the chart.
- getTopLeftXOffset() : int
- getTopLeftYOffset() : int
- getWorksheet() : Worksheet|null
- Get Worksheet.
- getXAxisLabel() : Title|null
- getYAxisLabel() : Title|null
- refresh() : void
- render() : bool
- Render the chart to given file (or stream).
- setAutoTitleDeleted() : self
- setBorderLines() : self
- setBottomRightCell() : $this
- Set the Bottom Right cell for the chart.
- setBottomRightOffset() : $this
- Set the offset position within the Bottom Right cell for the chart.
- setBottomRightPosition() : $this
- Set the Bottom Right position of the chart.
- setBottomRightXOffset() : $this
- setBottomRightYOffset() : $this
- setChartAxisX() : self
- Set xAxis.
- setChartAxisY() : self
- Set yAxis.
- setDisplayBlanksAs() : $this
- Set Display Blanks as.
- setLegend() : $this
- Set Legend.
- setName() : self
- setNoFill() : self
- setOneCellAnchor() : self
- setPerspective() : self
- setPlotArea() : self
- Set Plot Area.
- setPlotVisibleOnly() : $this
- Set Plot Visible Only.
- setRAngAx() : self
- setRotX() : self
- setRotY() : self
- setRoundedCorners() : self
- setTitle() : $this
- Set Title.
- setTopLeftCell() : $this
- Set the Top Left cell position for the chart.
- setTopLeftOffset() : $this
- Set the offset position within the Top Left cell for the chart.
- setTopLeftPosition() : $this
- Set the Top Left position for the chart.
- setTopLeftXOffset() : $this
- setTopLeftYOffset() : $this
- setWorksheet() : $this
- Set Worksheet.
- setXAxisLabel() : $this
- Set X-Axis Label.
- setYAxisLabel() : $this
- Set Y-Axis Label.
Properties
$autoTitleDeleted
private
bool
$autoTitleDeleted
= false
$borderLines
private
GridLines
$borderLines
$bottomRightCellRef
Bottom-Right Cell Position.
private
string
$bottomRightCellRef
= ''
$bottomRightXOffset
Bottom-Right X-Offset.
private
int
$bottomRightXOffset
= 10
$bottomRightYOffset
Bottom-Right Y-Offset.
private
int
$bottomRightYOffset
= 10
$displayBlanksAs
Display Blanks as.
private
string
$displayBlanksAs
= PhpOfficePhpSpreadsheetChartDataSeries::EMPTY_AS_GAP
$fillColor
private
ChartColor
$fillColor
$legend
Chart Legend.
private
Legend|null
$legend
$name
Chart Name.
private
string
$name
= ''
$noFill
private
bool
$noFill
= false
$oneCellAnchor
private
bool
$oneCellAnchor
= false
$perspective
private
int|null
$perspective
$plotArea
Chart Plot Area.
private
PlotArea|null
$plotArea
$plotVisibleOnly
Plot Visible Only.
private
bool
$plotVisibleOnly
= true
$rAngAx
private
int|null
$rAngAx
$rotX
private
int|null
$rotX
$rotY
private
int|null
$rotY
$roundedCorners
private
bool
$roundedCorners
= false
$title
Chart Title.
private
Title|null
$title
$topLeftCellRef
Top-Left Cell Position.
private
string
$topLeftCellRef
= 'A1'
$topLeftXOffset
Top-Left X-Offset.
private
int
$topLeftXOffset
= 0
$topLeftYOffset
Top-Left Y-Offset.
private
int
$topLeftYOffset
= 0
$worksheet
Worksheet.
private
Worksheet|null
$worksheet
$xAxis
Chart Asix X as.
private
Axis
$xAxis
$xAxisLabel
X-Axis Label.
private
Title|null
$xAxisLabel
$yAxis
Chart Asix Y as.
private
Axis
$yAxis
$yAxisLabel
Y-Axis Label.
private
Title|null
$yAxisLabel
Methods
__construct()
Create a new Chart.
public
__construct(mixed $name[, Title|null $title = null ][, Legend|null $legend = null ][, PlotArea|null $plotArea = null ][, mixed $plotVisibleOnly = true ][, string $displayBlanksAs = DataSeries::EMPTY_AS_GAP ][, Title|null $xAxisLabel = null ][, Title|null $yAxisLabel = null ][, Axis|null $xAxis = null ][, Axis|null $yAxis = null ][, GridLines|null $majorGridlines = null ][, GridLines|null $minorGridlines = null ]) : mixed
majorGridlines and minorGridlines are deprecated, moved to Axis.
Parameters
- $name : mixed
- $title : Title|null = null
- $legend : Legend|null = null
- $plotArea : PlotArea|null = null
- $plotVisibleOnly : mixed = true
- $displayBlanksAs : string = DataSeries::EMPTY_AS_GAP
- $xAxisLabel : Title|null = null
- $yAxisLabel : Title|null = null
- $xAxis : Axis|null = null
- $yAxis : Axis|null = null
- $majorGridlines : GridLines|null = null
- $minorGridlines : GridLines|null = null
Return values
mixed —getAutoTitleDeleted()
public
getAutoTitleDeleted() : bool
Return values
bool —getBorderLines()
public
getBorderLines() : GridLines
Return values
GridLines —getBottomRightCell()
Get the cell address where the bottom right of the chart is fixed.
public
getBottomRightCell() : string
Return values
string —getBottomRightOffset()
Get the offset position within the Bottom Right cell for the chart.
public
getBottomRightOffset() : array<string|int, int>
Return values
array<string|int, int> —getBottomRightPosition()
Get the bottom right position of the chart.
public
getBottomRightPosition() : array<string|int, mixed>
Return values
array<string|int, mixed> —an associative array containing the cell address, X-Offset and Y-Offset from the top left of that cell
getBottomRightXOffset()
public
getBottomRightXOffset() : int
Return values
int —getBottomRightYOffset()
public
getBottomRightYOffset() : int
Return values
int —getChartAxisX()
public
getChartAxisX() : Axis
Return values
Axis —getChartAxisY()
public
getChartAxisY() : Axis
Return values
Axis —getDisplayBlanksAs()
Get Display Blanks as.
public
getDisplayBlanksAs() : string
Return values
string —getFillColor()
public
getFillColor() : ChartColor
Return values
ChartColor —getLegend()
public
getLegend() : Legend|null
Return values
Legend|null —getMajorGridlines()
Get Major Gridlines.
public
getMajorGridlines() : GridLines|null
Tags
Return values
GridLines|null —getMinorGridlines()
Get Minor Gridlines.
public
getMinorGridlines() : GridLines|null
Tags
Return values
GridLines|null —getName()
Get Name.
public
getName() : string
Return values
string —getNoFill()
public
getNoFill() : bool
Return values
bool —getOneCellAnchor()
public
getOneCellAnchor() : bool
Return values
bool —getPerspective()
public
getPerspective() : int|null
Return values
int|null —getPlotArea()
public
getPlotArea() : PlotArea|null
Return values
PlotArea|null —getPlotVisibleOnly()
Get Plot Visible Only.
public
getPlotVisibleOnly() : bool
Return values
bool —getRAngAx()
public
getRAngAx() : int|null
Return values
int|null —getRotX()
public
getRotX() : int|null
Return values
int|null —getRotY()
public
getRotY() : int|null
Return values
int|null —getRoundedCorners()
public
getRoundedCorners() : bool
Return values
bool —getTitle()
public
getTitle() : Title|null
Return values
Title|null —getTopLeftCell()
Get the cell address where the top left of the chart is fixed.
public
getTopLeftCell() : string
Return values
string —getTopLeftOffset()
Get the offset position within the Top Left cell for the chart.
public
getTopLeftOffset() : array<string|int, int>
Return values
array<string|int, int> —getTopLeftPosition()
Get the top left position of the chart.
public
getTopLeftPosition() : array<string|int, mixed>
Returns ['cell' => string cell address, 'xOffset' => int, 'yOffset' => int].
Return values
array<string|int, mixed> —getTopLeftXOffset()
public
getTopLeftXOffset() : int
Return values
int —getTopLeftYOffset()
public
getTopLeftYOffset() : int
Return values
int —getWorksheet()
Get Worksheet.
public
getWorksheet() : Worksheet|null
Return values
Worksheet|null —getXAxisLabel()
public
getXAxisLabel() : Title|null
Return values
Title|null —getYAxisLabel()
public
getYAxisLabel() : Title|null
Return values
Title|null —refresh()
public
refresh() : void
Return values
void —render()
Render the chart to given file (or stream).
public
render([string $outputDestination = null ]) : bool
Parameters
- $outputDestination : string = null
-
Name of the file render to
Return values
bool —true on success
setAutoTitleDeleted()
public
setAutoTitleDeleted(bool $autoTitleDeleted) : self
Parameters
- $autoTitleDeleted : bool
Return values
self —setBorderLines()
public
setBorderLines(GridLines $borderLines) : self
Parameters
- $borderLines : GridLines
Return values
self —setBottomRightCell()
Set the Bottom Right cell for the chart.
public
setBottomRightCell([string $cellAddress = '' ]) : $this
Parameters
- $cellAddress : string = ''
Return values
$this —setBottomRightOffset()
Set the offset position within the Bottom Right cell for the chart.
public
setBottomRightOffset(int|null $xOffset, int|null $yOffset) : $this
Parameters
- $xOffset : int|null
- $yOffset : int|null
Return values
$this —setBottomRightPosition()
Set the Bottom Right position of the chart.
public
setBottomRightPosition([string $cellAddress = '' ][, int $xOffset = null ][, int $yOffset = null ]) : $this
Parameters
- $cellAddress : string = ''
- $xOffset : int = null
- $yOffset : int = null
Return values
$this —setBottomRightXOffset()
public
setBottomRightXOffset(int $xOffset) : $this
Parameters
- $xOffset : int
Return values
$this —setBottomRightYOffset()
public
setBottomRightYOffset(int $yOffset) : $this
Parameters
- $yOffset : int
Return values
$this —setChartAxisX()
Set xAxis.
public
setChartAxisX(Axis|null $axis) : self
Parameters
- $axis : Axis|null
Return values
self —setChartAxisY()
Set yAxis.
public
setChartAxisY(Axis|null $axis) : self
Parameters
- $axis : Axis|null
Return values
self —setDisplayBlanksAs()
Set Display Blanks as.
public
setDisplayBlanksAs(string $displayBlanksAs) : $this
Parameters
- $displayBlanksAs : string
Return values
$this —setLegend()
Set Legend.
public
setLegend(Legend $legend) : $this
Parameters
- $legend : Legend
Return values
$this —setName()
public
setName(string $name) : self
Parameters
- $name : string
Return values
self —setNoFill()
public
setNoFill(bool $noFill) : self
Parameters
- $noFill : bool
Return values
self —setOneCellAnchor()
public
setOneCellAnchor(bool $oneCellAnchor) : self
Parameters
- $oneCellAnchor : bool
Return values
self —setPerspective()
public
setPerspective(int|null $perspective) : self
Parameters
- $perspective : int|null
Return values
self —setPlotArea()
Set Plot Area.
public
setPlotArea(PlotArea $plotArea) : self
Parameters
- $plotArea : PlotArea
Return values
self —setPlotVisibleOnly()
Set Plot Visible Only.
public
setPlotVisibleOnly(bool $plotVisibleOnly) : $this
Parameters
- $plotVisibleOnly : bool
Return values
$this —setRAngAx()
public
setRAngAx(int|null $rAngAx) : self
Parameters
- $rAngAx : int|null
Return values
self —setRotX()
public
setRotX(int|null $rotX) : self
Parameters
- $rotX : int|null
Return values
self —setRotY()
public
setRotY(int|null $rotY) : self
Parameters
- $rotY : int|null
Return values
self —setRoundedCorners()
public
setRoundedCorners(bool|null $roundedCorners) : self
Parameters
- $roundedCorners : bool|null
Return values
self —setTitle()
Set Title.
public
setTitle(Title $title) : $this
Parameters
- $title : Title
Return values
$this —setTopLeftCell()
Set the Top Left cell position for the chart.
public
setTopLeftCell(string $cellAddress) : $this
Parameters
- $cellAddress : string
Return values
$this —setTopLeftOffset()
Set the offset position within the Top Left cell for the chart.
public
setTopLeftOffset(int|null $xOffset, int|null $yOffset) : $this
Parameters
- $xOffset : int|null
- $yOffset : int|null
Return values
$this —setTopLeftPosition()
Set the Top Left position for the chart.
public
setTopLeftPosition(string $cellAddress[, int $xOffset = null ][, int $yOffset = null ]) : $this
Parameters
- $cellAddress : string
- $xOffset : int = null
- $yOffset : int = null
Return values
$this —setTopLeftXOffset()
public
setTopLeftXOffset(int $xOffset) : $this
Parameters
- $xOffset : int
Return values
$this —setTopLeftYOffset()
public
setTopLeftYOffset(int $yOffset) : $this
Parameters
- $yOffset : int
Return values
$this —setWorksheet()
Set Worksheet.
public
setWorksheet([Worksheet|null $worksheet = null ]) : $this
Parameters
- $worksheet : Worksheet|null = null
Return values
$this —setXAxisLabel()
Set X-Axis Label.
public
setXAxisLabel(Title $label) : $this
Parameters
- $label : Title
Return values
$this —setYAxisLabel()
Set Y-Axis Label.
public
setYAxisLabel(Title $label) : $this
Parameters
- $label : Title