/** * Used to address the different concepts of what constitutes a series in different JsWriters * @param array $dataSet * @param array $factorySettings the factory and the method call in an array * @param string|null $title * @param string|null $type * @throws \Exception * @return multitype:\Altamira\Series |\Altamira\Series */ public function createManySeries(array $dataSet, array $factorySettings, $title = null, $type = null) { if ($this->jsWriter instanceof \Altamira\JsWriter\Flot) { if (!empty($this->series) && $this->jsWriter->getType() == 'Donut') { throw new \Exception("Flot doesn't allow donut charts with multiple series"); } $seriesArray = array(); foreach ($dataSet as $data) { $seriesArray[] = $this->createSeries(call_user_func($factorySettings, array($data)), $data[0], $type); } return $seriesArray; } else { return $this->createSeries(call_user_func($factorySettings, $dataSet), $title, $type); } }