Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Class: Chart  - X-Ref

__construct($name, Title $title = null, Legend $legend = null, PlotArea $plotArea = null, $plotVisibleOnly = true, $displayBlanksAs = '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: null|Title $title
param: null|Legend $legend
param: null|PlotArea $plotArea
param: mixed $plotVisibleOnly
param: mixed $displayBlanksAs
param: null|Title $xAxisLabel
param: null|Title $yAxisLabel
param: null|Axis $xAxis
param: null|Axis $yAxis
param: null|GridLines $majorGridlines
param: null|GridLines $minorGridlines

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: Chart

getTitle()   X-Ref
Get Title.

return: Title

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

param: Title $title
return: Chart

getLegend()   X-Ref
Get Legend.

return: Legend

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

param: Legend $legend
return: Chart

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

return: Title

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

param: Title $label
return: Chart

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

return: Title

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

param: Title $label
return: Chart

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: Chart

getDisplayBlanksAs()   X-Ref
Get Display Blanks as.

return: string

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

param: string $displayBlanksAs
return: Chart

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: Chart

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: Chart

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

param: int $xOffset
param: int $yOffset
return: Chart

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: Chart

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: Chart

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