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);
    }