/**
  * Builds pie graph
  */
 function buildGraph()
 {
     $this->graph = new Chart_Pie($this->width, $this->height);
     // title setup
     $this->graph->title->Set($this->title);
     if (is_null($this->description)) {
         $this->description = "";
     }
     $this->graph->subtitle->Set($this->description);
     if (is_array($this->data) && array_sum($this->data) > 0) {
         $p = new PiePlot($this->data);
         $p->setSliceColors($this->graph->getThemedColors());
         $p->SetCenter(0.4, 0.6);
         $p->SetLegends($this->legend);
         $p->value->HideZero();
         $p->value->SetFont($this->graph->getFont(), FS_NORMAL, 8);
         $p->value->SetColor($this->graph->getMainColor());
         $p->value->SetMargin(0);
         $this->graph->Add($p);
     }
     return $this->graph;
 }