diff --git a/lib/classes/chart_series.php b/lib/classes/chart_series.php index ccc383ab4f3..2c5a93fcc9e 100644 --- a/lib/classes/chart_series.php +++ b/lib/classes/chart_series.php @@ -40,6 +40,7 @@ class chart_series implements JsonSerializable { const TYPE_DEFAULT = null; const TYPE_LINE = 'line'; + protected $color; protected $label; protected $type = self::TYPE_DEFAULT; protected $values = []; @@ -49,6 +50,10 @@ class chart_series implements JsonSerializable { $this->label = $label; } + public function get_color() { + return $this->color; + } + public function get_count() { return count($this->values); } @@ -69,7 +74,8 @@ class chart_series implements JsonSerializable { $data = [ 'label' => $this->label, 'type' => $this->type, - 'values' => $this->values + 'values' => $this->values, + 'color' => $this->color, ]; return $data; }