Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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.

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

getName()   X-Ref
Get Name.

return: string

getWorksheet()   X-Ref
Get Worksheet.

return: Worksheet

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

param: Worksheet $pValue
return: $this

getTitle()   X-Ref
Get Title.

return: Title

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

return: $this

getLegend()   X-Ref
Get Legend.

return: Legend

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

return: $this

getXAxisLabel()   X-Ref
Get X-Axis Label.

return: Title

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

return: $this

getYAxisLabel()   X-Ref
Get Y-Axis Label.

return: Title

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

return: $this

getPlotArea()   X-Ref
Get Plot Area.

return: PlotArea

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
Get yAxis.

return: Axis

getChartAxisX()   X-Ref
Get xAxis.

return: Axis

getMajorGridlines()   X-Ref
Get Major Gridlines.

return: GridLines

getMinorGridlines()   X-Ref
Get Minor Gridlines.

return: GridLines

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

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

getTopLeftPosition()   X-Ref
Get the top left 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

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

return: string

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

param: string $cell
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
No description

getTopLeftXOffset()   X-Ref
No description

setTopLeftYOffset($yOffset)   X-Ref
No description

getTopLeftYOffset()   X-Ref
No description

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

param: string $cell
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($cell)   X-Ref
No description

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

return: string

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
No description

getBottomRightXOffset()   X-Ref
No description

setBottomRightYOffset($yOffset)   X-Ref
No description

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