public function withChart(string $chartName) : ChartWidgetDefiner
    {
        if (!isset($this->charts[$chartName])) {
            throw InvalidArgumentException::format(
                'Invalid chart name supplied to %s: expecting one of (%s), \'%s\' given',
                __METHOD__, Debug::formatValues(array_keys($this->charts)), $chartName
            );
        }

        return new ChartWidgetDefiner($this->name, $this->label, $this->authSystem, $this->requiredPermissions, $this->charts[$chartName], $this->callback);
    }
public function withChart(string $chartName) : ChartWidgetDefiner
    {
        if (!isset($this->charts[$chartName])) {
            throw InvalidArgumentException::format(
                'Invalid chart name supplied to %s: expecting one of (%s), \'%s\' given',
                __METHOD__, Debug::formatValues(array_keys($this->charts)), $chartName
            );
        }

        return new ChartWidgetDefiner($this->name, $this->label, $this->authSystem, $this->requiredPermissions, $this->charts[$chartName], $this->callback);
    }
public function withChart ( string $ chartName ) : ChartWidgetDefiner { if ( ! isset ( $ this -> charts [ $ chartName ] ) ) { throw InvalidArgumentException :: format ( 'Invalid chart name supplied to %s: expecting one of (%s), \'%s\' given' , __METHOD__ , Debug :: formatValues ( array_keys ( $ this -> charts ) ) , $ chartName ) ; } return new ChartWidgetDefiner ( $ this -> name , $ this -> label , $ this -> authSystem , $ this -> requiredPermissions , $ this -> charts [ $ chartName ] , $ this -> callback ) ; }
Defines the chart of which to load the widget from.

@param string $chartName

@return ChartWidgetDefiner
@throws InvalidArgumentException
Defines the chart of which to load the widget from .