private function createChartData(Pap_Common_Reports_Chart_DataType $dataType, $lineColor) {
     $chartData = new Gpf_Chart_DataRecordSet($dataType->getName(), $lineColor);
     $chartData->setTooltip($dataType->getTooltip());
     return $chartData;
 }
Example #2
0
 private function createGraph(Gpf_Chart_DataRecordSet $data)
 {
     if ($this->chartType == Gpf_Rpc_Chart::CHART_TYPE_LINE_DOT && $this->data1->getSize() > 150) {
         $this->chartType = Gpf_Rpc_Chart::CHART_TYPE_LINE;
     }
     switch ($this->chartType) {
         case Gpf_Rpc_Chart::CHART_TYPE_AREA:
             if ($data->getSize() > 40) {
                 $areaGraph = new OFC_Charts_Area_Line();
             } else {
                 $areaGraph = new OFC_Charts_Area_Hollow();
             }
             $areaGraph->set_width(3);
             $areaGraph->set_dot_size(3);
             $areaGraph->set_colour($data->getColor());
             $areaGraph->set_key($data->getName(), 10);
             $areaGraph->set_values($data->getValues());
             $areaGraph->set_tooltip($data->getTooltip());
             return $areaGraph;
         case Gpf_Rpc_Chart::CHART_TYPE_BAR_OUTLINE:
             $barGraph = new OFC_Charts_Bar();
             $barGraph->set_alpha(50);
             $barGraph->set_colour($data->getColor());
             $barGraph->set_key($data->getName(), 10);
             $barGraph->set_values($data->getValues());
             $barGraph->set_tooltip($data->getTooltip());
             return $barGraph;
         case Gpf_Rpc_Chart::CHART_TYPE_LINE_DOT:
             $lineDotGraph = new OFC_Charts_Line_Dot();
             $lineDotGraph->set_width(3);
             $lineDotGraph->set_dot_size(3);
             $lineDotGraph->set_colour($data->getColor());
             $lineDotGraph->set_key($data->getName(), 10);
             $lineDotGraph->set_values($data->getValues());
             $lineDotGraph->set_tooltip($data->getTooltip());
             return $lineDotGraph;
         default:
             $lineGraph = new OFC_Charts_Line();
             $lineGraph->set_width(3);
             $lineGraph->set_dot_size(3);
             $lineGraph->set_colour($data->getColor());
             $lineGraph->set_key($data->getName(), 10);
             $lineGraph->set_values($data->getValues());
             $lineGraph->set_tooltip($data->getTooltip());
             return $lineGraph;
     }
 }