/** * Custom serialization of the ChartWrapper. * * @return array */ public function jsonSerialize() { if ($this->wrappedObject instanceof Chart) { $type = 'chartType'; } if ($this->wrappedObject instanceof Filter) { $type = 'controlType'; } return [$type => $this->wrappedObject->getType(), 'containerId' => (string) $this->containerId, 'options' => $this->wrappedObject]; }
/** * Creates the new Filter object to filter the given column label or index. * * @param string|int $columnLabelOrIndex The column label or index to filter. * @param array $config Array of options to set. * @throws \Khill\Lavacharts\Exceptions\InvalidConfigProperty * @throws \Khill\Lavacharts\Exceptions\InvalidConfigValue */ public function __construct($columnLabelOrIndex, $config = []) { $options = new Options($this->defaults); $options->extend($this->extDefaults); parent::__construct($options, $columnLabelOrIndex, $config); }