/** * * Render this graph and return the created SVG * * @return string The SVG created by the SvgRenderer * * @throws Exception Thrown wen the dataset is not valid for this graph * @see SVGRenderer::render */ public function render() { if (!$this->isValidDataFormat()) { throw new Exception('Dataset for graph doesn\'t have the proper structure'); } $this->build(); $this->renderer->getCanvas()->addElement($this); return $this->renderer->render(); }
/** * Render this graph and return the created SVG * * @return string The SVG created by the SvgRenderer * * @throws IcingaException Thrown wen the dataset is not valid for this graph * @see SVGRenderer::render */ public function render() { if (!$this->isValidDataFormat()) { throw new IcingaException('Dataset for graph doesn\'t have the proper structure'); } $this->build(); if ($this->align) { $this->renderer->preserveAspectRatio(); $this->renderer->setXAspectRatioAlignment(SVGRenderer::X_ASPECT_RATIO_MIN); $this->renderer->setYAspectRatioAlignment(SVGRenderer::Y_ASPECT_RATIO_MIN); } $this->renderer->setAriaDescription($this->description); $this->renderer->setAriaTitle($this->title); $this->renderer->getCanvas()->setAriaRole('presentation'); $this->renderer->getCanvas()->addElement($this); return $this->renderer->render(); }