src/Classes/Frappe/Chart.php
public function formatOptions(bool $strict = false, bool $noBraces = false)
    {
        $colors = [];
        $default = 0;
        foreach ($this->datasets as $dataset) {
            $color = $this->default_colors[$default];
            if (array_key_exists('color', $dataset->options)) {
                $color = $dataset->options['color'];
                unset($dataset->options['color']);
            } else {
                $default++;
            }
            array_push($colors, $color);
        }

        $this->options([
            'colors' => $colors,
        ]);

        return parent::formatOptions($strict, $noBraces);
    }
public function formatOptions(bool $strict = false, bool $noBraces = false)
    {
        $colors = [];
        $default = 0;
        foreach ($this->datasets as $dataset) {
            $color = $this->default_colors[$default];
            if (array_key_exists('color', $dataset->options)) {
                $color = $dataset->options['color'];
                unset($dataset->options['color']);
            } else {
                $default++;
            }
            array_push($colors, $color);
        }

        $this->options([
            'colors' => $colors,
        ]);

        return parent::formatOptions($strict, $noBraces);
    }
public function formatOptions ( bool $ strict = false , bool $ noBraces = false ) { $ colors = [ ] ; $ default = 0 ; foreach ( $ this -> datasets as $ dataset ) { $ color = $ this -> default_colors [ $ default ] ; if ( array_key_exists ( 'color' , $ dataset -> options ) ) { $ color = $ dataset -> options [ 'color' ] ; unset ( $ dataset -> options [ 'color' ] ) ; } else { $ default ++ ; } array_push ( $ colors , $ color ) ; } $ this -> options ( [ 'colors' => $ colors , ] ) ; return parent :: formatOptions ( $ strict , $ noBraces ) ; }
Format the datasets.

@param bool $strict
@param bool $noBraces

@return self
Format the datasets .