alignTopLeft(); $pie->disableLegend(); $pie->drawPie(array( 'data' => $this->data, 'colors' => $this->colors, 'labels' => $this->labels )); if ($output) { echo $pie->render(); } else { return $pie->render(); } } public function toPng() { if (! class_exists('Imagick')) { // TODO: This is quick & dirty. 404? throw new IcingaException('Cannot render PNGs without Imagick'); } $image = new Imagick(); $image->readImageBlob($this->render(false)); $image->setImageFormat('png24'); $image->resizeImage($this->width, $this->height, imagick::FILTER_LANCZOS, 1); echo $image; } }