$labels * @param array $series */ public function __construct( public readonly array $labels, public readonly array $series, ) { foreach ($series as $one) { if (count($one->values) !== count($labels)) { throw new InvalidArgumentException( "Series [{$one->name}] has ".count($one->values).' values for '.count($labels).' labels.' ); } } } public static function tooWide(): self { $result = new self([], []); $result->tooWide = true; return $result; } public function isTooWide(): bool { return $this->tooWide; } public function isEmpty(): bool { return ! $this->tooWide && $this->labels === []; } }