Properties

$name

$name : string

Chart Name.

Type

string

$worksheet

$worksheet : \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet

Worksheet.

Type

Worksheet

$title

$title : \PhpOffice\PhpSpreadsheet\Chart\Title

Chart Title.

Type

Title

$legend

$legend : \PhpOffice\PhpSpreadsheet\Chart\Legend

Chart Legend.

Type

Legend

$xAxisLabel

$xAxisLabel : \PhpOffice\PhpSpreadsheet\Chart\Title

X-Axis Label.

Type

Title

$yAxisLabel

$yAxisLabel : \PhpOffice\PhpSpreadsheet\Chart\Title

Y-Axis Label.

Type

Title

$plotArea

$plotArea : \PhpOffice\PhpSpreadsheet\Chart\PlotArea

Chart Plot Area.

Type

PlotArea

$plotVisibleOnly

$plotVisibleOnly : bool

Plot Visible Only.

Type

bool

$displayBlanksAs

$displayBlanksAs : string

Display Blanks as.

Type

string

$yAxis

$yAxis : \PhpOffice\PhpSpreadsheet\Chart\Axis

Chart Asix Y as.

Type

Axis

$xAxis

$xAxis : \PhpOffice\PhpSpreadsheet\Chart\Axis

Chart Asix X as.

Type

Axis

$majorGridlines

$majorGridlines : \PhpOffice\PhpSpreadsheet\Chart\GridLines

Chart Major Gridlines as.

Type

GridLines

$minorGridlines

$minorGridlines : \PhpOffice\PhpSpreadsheet\Chart\GridLines

Chart Minor Gridlines as.

Type

GridLines

$topLeftCellRef

$topLeftCellRef : string

Top-Left Cell Position.

Type

string

$topLeftXOffset

$topLeftXOffset : int

Top-Left X-Offset.

Type

int

$topLeftYOffset

$topLeftYOffset : int

Top-Left Y-Offset.

Type

int

$bottomRightCellRef

$bottomRightCellRef : string

Bottom-Right Cell Position.

Type

string

$bottomRightXOffset

$bottomRightXOffset : int

Bottom-Right X-Offset.

Type

int

$bottomRightYOffset

$bottomRightYOffset : int

Bottom-Right Y-Offset.

Type

int

Methods

__construct()

__construct(mixed  $name, ?\PhpOffice\PhpSpreadsheet\Chart\Title  $title = null, ?\PhpOffice\PhpSpreadsheet\Chart\Legend  $legend = null, ?\PhpOffice\PhpSpreadsheet\Chart\PlotArea  $plotArea = null, mixed  $plotVisibleOnly = true, string  $displayBlanksAs = DataSeries::EMPTY_AS_GAP, ?\PhpOffice\PhpSpreadsheet\Chart\Title  $xAxisLabel = null, ?\PhpOffice\PhpSpreadsheet\Chart\Title  $yAxisLabel = null, ?\PhpOffice\PhpSpreadsheet\Chart\Axis  $xAxis = null, ?\PhpOffice\PhpSpreadsheet\Chart\Axis  $yAxis = null, ?\PhpOffice\PhpSpreadsheet\Chart\GridLines  $majorGridlines = null, ?\PhpOffice\PhpSpreadsheet\Chart\GridLines  $minorGridlines = null) : mixed

Create a new Chart.

Parameters

mixed $name
?\PhpOffice\PhpSpreadsheet\Chart\Title $title
?\PhpOffice\PhpSpreadsheet\Chart\Legend $legend
?\PhpOffice\PhpSpreadsheet\Chart\PlotArea $plotArea
mixed $plotVisibleOnly
string $displayBlanksAs
?\PhpOffice\PhpSpreadsheet\Chart\Title $xAxisLabel
?\PhpOffice\PhpSpreadsheet\Chart\Title $yAxisLabel
?\PhpOffice\PhpSpreadsheet\Chart\Axis $xAxis
?\PhpOffice\PhpSpreadsheet\Chart\Axis $yAxis
?\PhpOffice\PhpSpreadsheet\Chart\GridLines $majorGridlines
?\PhpOffice\PhpSpreadsheet\Chart\GridLines $minorGridlines

Returns

mixed —

getName()

getName() : string

Get Name.

Returns

string —

getWorksheet()

getWorksheet() : \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet

Get Worksheet.

Returns

\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet —

setWorksheet()

setWorksheet(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet  $pValue = null) : $this

Set Worksheet.

Parameters

\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pValue

Returns

$this —

getTitle()

getTitle() : \PhpOffice\PhpSpreadsheet\Chart\Title

Get Title.

Returns

\PhpOffice\PhpSpreadsheet\Chart\Title —

setTitle()

setTitle(\PhpOffice\PhpSpreadsheet\Chart\Title  $title) : $this

Set Title.

Parameters

\PhpOffice\PhpSpreadsheet\Chart\Title $title

Returns

$this —

getLegend()

getLegend() : \PhpOffice\PhpSpreadsheet\Chart\Legend

Get Legend.

Returns

\PhpOffice\PhpSpreadsheet\Chart\Legend —

setLegend()

setLegend(\PhpOffice\PhpSpreadsheet\Chart\Legend  $legend) : $this

Set Legend.

Parameters

\PhpOffice\PhpSpreadsheet\Chart\Legend $legend

Returns

$this —

getXAxisLabel()

getXAxisLabel() : \PhpOffice\PhpSpreadsheet\Chart\Title

Get X-Axis Label.

Returns

\PhpOffice\PhpSpreadsheet\Chart\Title —

setXAxisLabel()

setXAxisLabel(\PhpOffice\PhpSpreadsheet\Chart\Title  $label) : $this

Set X-Axis Label.

Parameters

\PhpOffice\PhpSpreadsheet\Chart\Title $label

Returns

$this —

getYAxisLabel()

getYAxisLabel() : \PhpOffice\PhpSpreadsheet\Chart\Title

Get Y-Axis Label.

Returns

\PhpOffice\PhpSpreadsheet\Chart\Title —

setYAxisLabel()

setYAxisLabel(\PhpOffice\PhpSpreadsheet\Chart\Title  $label) : $this

Set Y-Axis Label.

Parameters

\PhpOffice\PhpSpreadsheet\Chart\Title $label

Returns

$this —

getPlotArea()

getPlotArea() : \PhpOffice\PhpSpreadsheet\Chart\PlotArea

Get Plot Area.

Returns

\PhpOffice\PhpSpreadsheet\Chart\PlotArea —

getPlotVisibleOnly()

getPlotVisibleOnly() : bool

Get Plot Visible Only.

Returns

bool —

setPlotVisibleOnly()

setPlotVisibleOnly(bool  $plotVisibleOnly) : $this

Set Plot Visible Only.

Parameters

bool $plotVisibleOnly

Returns

$this —

getDisplayBlanksAs()

getDisplayBlanksAs() : string

Get Display Blanks as.

Returns

string —

setDisplayBlanksAs()

setDisplayBlanksAs(string  $displayBlanksAs) : $this

Set Display Blanks as.

Parameters

string $displayBlanksAs

Returns

$this —

getChartAxisY()

getChartAxisY() : \PhpOffice\PhpSpreadsheet\Chart\Axis

Get yAxis.

Returns

\PhpOffice\PhpSpreadsheet\Chart\Axis —

getChartAxisX()

getChartAxisX() : \PhpOffice\PhpSpreadsheet\Chart\Axis

Get xAxis.

Returns

\PhpOffice\PhpSpreadsheet\Chart\Axis —

getMajorGridlines()

getMajorGridlines() : \PhpOffice\PhpSpreadsheet\Chart\GridLines

Get Major Gridlines.

Returns

\PhpOffice\PhpSpreadsheet\Chart\GridLines —

getMinorGridlines()

getMinorGridlines() : \PhpOffice\PhpSpreadsheet\Chart\GridLines

Get Minor Gridlines.

Returns

\PhpOffice\PhpSpreadsheet\Chart\GridLines —

setTopLeftPosition()

setTopLeftPosition(string  $cell, int  $xOffset = null, int  $yOffset = null) : $this

Set the Top Left position for the chart.

Parameters

string $cell
int $xOffset
int $yOffset

Returns

$this —

getTopLeftPosition()

getTopLeftPosition() : array

Get the top left position of the chart.

Returns

array —

an associative array containing the cell address, X-Offset and Y-Offset from the top left of that cell

getTopLeftCell()

getTopLeftCell() : string

Get the cell address where the top left of the chart is fixed.

Returns

string —

setTopLeftCell()

setTopLeftCell(string  $cell) : $this

Set the Top Left cell position for the chart.

Parameters

string $cell

Returns

$this —

setTopLeftOffset()

setTopLeftOffset(int  $xOffset, int  $yOffset) : $this

Set the offset position within the Top Left cell for the chart.

Parameters

int $xOffset
int $yOffset

Returns

$this —

getTopLeftOffset()

getTopLeftOffset() : int[]

Get the offset position within the Top Left cell for the chart.

Returns

int[] —

setTopLeftXOffset()

setTopLeftXOffset(mixed  $xOffset) : mixed

Parameters

mixed $xOffset

Returns

mixed —

getTopLeftXOffset()

getTopLeftXOffset() : mixed

Returns

mixed —

setTopLeftYOffset()

setTopLeftYOffset(mixed  $yOffset) : mixed

Parameters

mixed $yOffset

Returns

mixed —

getTopLeftYOffset()

getTopLeftYOffset() : mixed

Returns

mixed —

setBottomRightPosition()

setBottomRightPosition(string  $cell, int  $xOffset = null, int  $yOffset = null) : $this

Set the Bottom Right position of the chart.

Parameters

string $cell
int $xOffset
int $yOffset

Returns

$this —

getBottomRightPosition()

getBottomRightPosition() : array

Get the bottom right position of the chart.

Returns

array —

an associative array containing the cell address, X-Offset and Y-Offset from the top left of that cell

setBottomRightCell()

setBottomRightCell(mixed  $cell) : mixed

Parameters

mixed $cell

Returns

mixed —

getBottomRightCell()

getBottomRightCell() : string

Get the cell address where the bottom right of the chart is fixed.

Returns

string —

setBottomRightOffset()

setBottomRightOffset(int  $xOffset, int  $yOffset) : $this

Set the offset position within the Bottom Right cell for the chart.

Parameters

int $xOffset
int $yOffset

Returns

$this —

getBottomRightOffset()

getBottomRightOffset() : int[]

Get the offset position within the Bottom Right cell for the chart.

Returns

int[] —

setBottomRightXOffset()

setBottomRightXOffset(mixed  $xOffset) : mixed

Parameters

mixed $xOffset

Returns

mixed —

getBottomRightXOffset()

getBottomRightXOffset() : mixed

Returns

mixed —

setBottomRightYOffset()

setBottomRightYOffset(mixed  $yOffset) : mixed

Parameters

mixed $yOffset

Returns

mixed —

getBottomRightYOffset()

getBottomRightYOffset() : mixed

Returns

mixed —

refresh()

refresh() : void

render()

render(string  $outputDestination = null) : bool

Render the chart to given file (or stream).

Parameters

string $outputDestination

Name of the file render to

Returns

bool —

true on success