Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401] [Versions 401 and 402] [Versions 401 and 403]

(no description)

File Size: 785 lines (16 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: Chart  - X-Ref

__construct($name, ?Title $title = null, ?Legend $legend = null, ?PlotArea $plotArea = null, $plotVisibleOnly = true, $displayBlanksAs = DataSeries::EMPTY_AS_GAP, ?Title $xAxisLabel = null, ?Title $yAxisLabel = null, ?Axis $xAxis = null, ?Axis $yAxis = null, ?GridLines $majorGridlines = null, ?GridLines $minorGridlines = null)   X-Ref
Create a new Chart.
majorGridlines and minorGridlines are deprecated, moved to Axis.

param: mixed $name
param: mixed $plotVisibleOnly
param: string $displayBlanksAs

getName()   X-Ref
Get Name.

return: string

setName(string $name)   X-Ref
No description

getWorksheet()   X-Ref
Get Worksheet.


setWorksheet(?Worksheet $worksheet = null)   X-Ref
Set Worksheet.

return: $this

getTitle()   X-Ref
No description

setTitle(Title $title)   X-Ref
Set Title.

return: $this

getLegend()   X-Ref
No description

setLegend(Legend $legend)   X-Ref
Set Legend.

return: $this

getXAxisLabel()   X-Ref
No description

setXAxisLabel(Title $label)   X-Ref
Set X-Axis Label.

return: $this

getYAxisLabel()   X-Ref
No description

setYAxisLabel(Title $label)   X-Ref
Set Y-Axis Label.

return: $this

getPlotArea()   X-Ref
No description

setPlotArea(PlotArea $plotArea)   X-Ref
Set Plot Area.


getPlotVisibleOnly()   X-Ref
Get Plot Visible Only.

return: bool

setPlotVisibleOnly($plotVisibleOnly)   X-Ref
Set Plot Visible Only.

param: bool $plotVisibleOnly
return: $this

getDisplayBlanksAs()   X-Ref
Get Display Blanks as.

return: string

setDisplayBlanksAs($displayBlanksAs)   X-Ref
Set Display Blanks as.

param: string $displayBlanksAs
return: $this

getChartAxisY()   X-Ref
No description

setChartAxisY(?Axis $axis)   X-Ref
Set yAxis.


getChartAxisX()   X-Ref
No description

setChartAxisX(?Axis $axis)   X-Ref
Set xAxis.


getMajorGridlines()   X-Ref
Get Major Gridlines.


getMinorGridlines()   X-Ref
Get Minor Gridlines.


setTopLeftPosition($cellAddress, $xOffset = null, $yOffset = null)   X-Ref
Set the Top Left position for the chart.

param: string $cellAddress
param: int $xOffset
param: int $yOffset
return: $this

getTopLeftPosition()   X-Ref
Get the top left position of the chart.

return: array{cell: string, xOffset: int, yOffset: int} an associative array containing the cell address, X-Offset and Y-Offset from the top left of that cell

getTopLeftCell()   X-Ref
Get the cell address where the top left of the chart is fixed.

return: string

setTopLeftCell($cellAddress)   X-Ref
Set the Top Left cell position for the chart.

param: string $cellAddress
return: $this

setTopLeftOffset($xOffset, $yOffset)   X-Ref
Set the offset position within the Top Left cell for the chart.

param: int $xOffset
param: int $yOffset
return: $this

getTopLeftOffset()   X-Ref
Get the offset position within the Top Left cell for the chart.

return: int[]

setTopLeftXOffset($xOffset)   X-Ref

param: int $xOffset
return: $this

getTopLeftXOffset()   X-Ref
No description

setTopLeftYOffset($yOffset)   X-Ref

param: int $yOffset
return: $this

getTopLeftYOffset()   X-Ref
No description

setBottomRightPosition($cellAddress = '', $xOffset = null, $yOffset = null)   X-Ref
Set the Bottom Right position of the chart.

param: string $cellAddress
param: int $xOffset
param: int $yOffset
return: $this

getBottomRightPosition()   X-Ref
Get the bottom right position of the chart.

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

setBottomRightCell(string $cellAddress = '')   X-Ref
Set the Bottom Right cell for the chart.

return: $this

getBottomRightCell()   X-Ref
Get the cell address where the bottom right of the chart is fixed.


setBottomRightOffset($xOffset, $yOffset)   X-Ref
Set the offset position within the Bottom Right cell for the chart.

param: int $xOffset
param: int $yOffset
return: $this

getBottomRightOffset()   X-Ref
Get the offset position within the Bottom Right cell for the chart.

return: int[]

setBottomRightXOffset($xOffset)   X-Ref

param: int $xOffset
return: $this

getBottomRightXOffset()   X-Ref
No description

setBottomRightYOffset($yOffset)   X-Ref

param: int $yOffset
return: $this

getBottomRightYOffset()   X-Ref
No description

refresh()   X-Ref
No description

render($outputDestination = null)   X-Ref
Render the chart to given file (or stream).

param: string $outputDestination Name of the file render to
return: bool true on success

getRotX()   X-Ref
No description

setRotX(?int $rotX)   X-Ref
No description

getRotY()   X-Ref
No description

setRotY(?int $rotY)   X-Ref
No description

getRAngAx()   X-Ref
No description

setRAngAx(?int $rAngAx)   X-Ref
No description

getPerspective()   X-Ref
No description

setPerspective(?int $perspective)   X-Ref
No description

getOneCellAnchor()   X-Ref
No description

setOneCellAnchor(bool $oneCellAnchor)   X-Ref
No description

getAutoTitleDeleted()   X-Ref
No description

setAutoTitleDeleted(bool $autoTitleDeleted)   X-Ref
No description

getNoFill()   X-Ref
No description

setNoFill(bool $noFill)   X-Ref
No description

getRoundedCorners()   X-Ref
No description

setRoundedCorners(?bool $roundedCorners)   X-Ref
No description