fillBackground = true; $this->opaque = $opaque; return $this; } protected function fillColor(array $colors = []) { $colors = $colors ?: $this->colors; $bgColors = $this->opaque ? $colors : $this->backgroundColors; foreach ($this->data['datasets'] as &$item) { if (empty($item['strokeColor'])) { $color = array_shift($colors); $bgColor = array_shift($bgColors); $item['borderColor'] = $color; $item['backgroundColor'] = $this->fillBackground ? $bgColor : 'rgba(255, 255, 255, 0.1)'; } } } public function showLines(bool $val) { return $this->options(['showLines' => $val]); } public function spanGaps(bool $val) { return $this->options(['spanGaps' => $val]); } }