src/Classes/BaseChart.php
public function options($options, bool $overwrite = false)
    {
        if (!empty($options['plugins'])) {
            $options['plugins'] = new Raw(trim(preg_replace('/\s\s+/', ' ', $options['plugins'])));
        }

        if ($options instanceof Collection) {
            $options = $options->toArray();
        }
        if ($overwrite) {
            $this->options = $options;
        } else {
            $this->options = array_replace_recursive($this->options, $options);
        }

        return $this;
    }
public function options($options, bool $overwrite = false)
    {
        if (!empty($options['plugins'])) {
            $options['plugins'] = new Raw(trim(preg_replace('/\s\s+/', ' ', $options['plugins'])));
        }

        if ($options instanceof Collection) {
            $options = $options->toArray();
        }
        if ($overwrite) {
            $this->options = $options;
        } else {
            $this->options = array_replace_recursive($this->options, $options);
        }

        return $this;
    }
public function options ( $ options , bool $ overwrite = false ) { if ( ! empty ( $ options [ 'plugins' ] ) ) { $ options [ 'plugins' ] = new Raw ( trim ( preg_replace ( '/\s\s+/' , ' ' , $ options [ 'plugins' ] ) ) ) ; } if ( $ options instanceof Collection ) { $ options = $ options -> toArray ( ) ; } if ( $ overwrite ) { $ this -> options = $ options ; } else { $ this -> options = array_replace_recursive ( $ this -> options , $ options ) ; } return $ this ; }
Set the chart options.

@param array|Collection $options
@param bool             $overwrite

@return self
Set the chart options .