Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
core\chart_series Class Reference

Chart series class. More...

Inheritance diagram for core\chart_series:

Public Member Functions

 __construct ($label, $values)
 Constructor.
 
 get_color ()
 Get the color.
 
 get_colors ()
 Get the colors for each value in the series.
 
 get_count ()
 Get the number of values in this series.
 
 get_fill ()
 Get area fill mode for series.
 
 get_label ()
 Get the label of the series.
 
 get_labels ()
 Set labels for the values of the series.
 
 get_smooth ()
 Get whether the line of the serie should be smooth or not.
 
 get_type ()
 Get the type of series.
 
 get_values ()
 Get the values of the series.
 
 get_xaxis ()
 Get the index of the X axis.
 
 get_yaxis ()
 Get the index of the Y axis.
 
 has_colored_values ()
 Whether there is a color per value.
 
 jsonSerialize ()
 Serialize the object.
 
 set_color ($color)
 Set the color of the series.
 
 set_colors (array $colors)
 Set a color for each value in the series.
 
 set_fill ($fill)
 Set fill mode for the series.
 
 set_labels ($labels)
 Set labels for the values of the series.
 
 set_smooth ($smooth)
 Set whether the line of the serie should be smooth or not.
 
 set_type ($type)
 Set the type of the series.
 
 set_xaxis ($index)
 Set the index of the X axis.
 
 set_yaxis ($index)
 Set the index of the Y axis.
 

Public Attributes

const TYPE_DEFAULT = null
 Default type for a series.
 
const TYPE_LINE = 'line'
 Series of type line.
 

Protected Attributes

string[] $colors = []
 Colors of the series.
 
string $fill = null
 Fill mode for area charts.
 
string $label
 Label for this series.
 
string[] $labels = null
 Labels for the values of the series.
 
bool $smooth = null
 Whether the line of the serie should be smooth or not.
 
string $type = self::TYPE_DEFAULT
 Type of the series.
 
float[] $values = []
 Values of the series.
 
int $xaxis = null
 Index of the X axis.
 
int $yaxis = null
 Index of the Y axis.
 

Detailed Description

Chart series class.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

core\chart_series::__construct ( $label,
$values )

Constructor.

Parameters
string$labelThe label of the series.
float[]$valuesThe values of this series.

Member Function Documentation

◆ get_color()

core\chart_series::get_color ( )

Get the color.

Return values
string|null

◆ get_colors()

core\chart_series::get_colors ( )

Get the colors for each value in the series.

Return values
string[]

◆ get_count()

core\chart_series::get_count ( )

Get the number of values in this series.

Return values
int

◆ get_label()

core\chart_series::get_label ( )

Get the label of the series.

Return values
string

◆ get_labels()

core\chart_series::get_labels ( )

Set labels for the values of the series.

Return values
array

◆ get_smooth()

core\chart_series::get_smooth ( )

Get whether the line of the serie should be smooth or not.

Return values
bool

◆ get_type()

core\chart_series::get_type ( )

Get the type of series.

Return values
string

◆ get_values()

core\chart_series::get_values ( )

Get the values of the series.

Return values
string[]

◆ get_xaxis()

core\chart_series::get_xaxis ( )

Get the index of the X axis.

Return values
int

◆ get_yaxis()

core\chart_series::get_yaxis ( )

Get the index of the Y axis.

Return values
int

◆ has_colored_values()

core\chart_series::has_colored_values ( )

Whether there is a color per value.

Return values
bool

◆ jsonSerialize()

core\chart_series::jsonSerialize ( )

Serialize the object.

Return values
array

◆ set_color()

core\chart_series::set_color ( $color)

Set the color of the series.

Parameters
string$colorCSS compatible color.

◆ set_colors()

core\chart_series::set_colors ( array $colors)

Set a color for each value in the series.

Parameters
string[]$colorsCSS compatible colors.

◆ set_fill()

core\chart_series::set_fill ( $fill)

Set fill mode for the series.

Parameters
string$fill

◆ set_labels()

core\chart_series::set_labels ( $labels)

Set labels for the values of the series.

Parameters
array$labelsThe labels for the series values.

◆ set_smooth()

core\chart_series::set_smooth ( $smooth)

Set whether the line of the serie should be smooth or not.

Only applicable for line chart or a line series, if null it assumes the chart default (not smooth).

Parameters
bool$smoothTrue if the line should be smooth, false for tensioned lines.

◆ set_type()

core\chart_series::set_type ( $type)

Set the type of the series.

Parameters
string$typeConstant value from self\TYPE_*.

◆ set_xaxis()

core\chart_series::set_xaxis ( $index)

Set the index of the X axis.

Parameters
int$indexThe index.

◆ set_yaxis()

core\chart_series::set_yaxis ( $index)

Set the index of the Y axis.

Parameters
int$indexThe index.

Member Data Documentation

◆ $fill

string core\chart_series::$fill = null
protected

The documentation for this class was generated from the following file: