diff --git a/libraries/chart/pChart/pChart.class b/libraries/chart/pChart/pChart.class index 9acbdafcf..6d521a2d7 100644 --- a/libraries/chart/pChart/pChart.class +++ b/libraries/chart/pChart/pChart.class @@ -198,17 +198,10 @@ { $this->XSize = $XSize; $this->YSize = $YSize; - echo "before imagecreatetruecolor\n"; - echo "php version:".phpversion(); - var_dump(function_exists('gd_info')); $this->Picture = imagecreatetruecolor($XSize,$YSize); - echo "before this->AllocateColor\n"; $C_White =$this->AllocateColor($this->Picture,255,255,255); - echo "before imagefilledrectangle\n"; imagefilledrectangle($this->Picture,0,0,$XSize,$YSize,$C_White); - echo "before imagecolortransparent"; imagecolortransparent($this->Picture,$C_White); - echo "after imagecolortransparent"; $this->setFontProperties("tahoma.ttf",8); } diff --git a/libraries/chart/pma_pchart_chart.php b/libraries/chart/pma_pchart_chart.php index 3c6648ad4..dd83fd91a 100644 --- a/libraries/chart/pma_pchart_chart.php +++ b/libraries/chart/pma_pchart_chart.php @@ -33,26 +33,26 @@ abstract class PMA_pChart_Chart extends PMA_Chart protected function render() { - echo "before ob_start"; ob_start(); imagepng($this->chart->Picture); $output = ob_get_contents(); ob_end_clean(); - echo "after ob_end_clean"; $this->imageEncoded = base64_encode($output); } public function toString() { - $this->prepareDataSet(); - echo "after neprepareDataSetw"; - $this->prepareChart(); - echo "after prepareChart"; - $this->render(); - echo "after render"; + if (function_exists('gd_info')) { + $this->prepareDataSet(); + $this->prepareChart(); + $this->render(); - return ''; + return ''; + } + else { + return 'Missing GD library.'; + } } protected function getFontPath() diff --git a/libraries/chart/pma_pchart_pie.php b/libraries/chart/pma_pchart_pie.php index c12a0dcdd..418dab7a0 100644 --- a/libraries/chart/pma_pchart_pie.php +++ b/libraries/chart/pma_pchart_pie.php @@ -25,9 +25,7 @@ class PMA_pChart_Pie extends PMA_pChart_Chart protected function prepareChart() { // Initialise the graph - echo "before new\n"; $this->chart = new pChart($this->getWidth(), $this->getHeight()); - echo "after new\n"; foreach ($this->getColors() as $key => $color) { $this->chart->setColorPalette( $key, @@ -36,9 +34,7 @@ class PMA_pChart_Pie extends PMA_pChart_Chart hexdec(substr($color, 5, 2)) ); } - echo "after palette\n"; $this->chart->setFontProperties($this->getFontPath().'tahoma.ttf', 8); - echo "after font\n"; $this->chart->drawFilledRoundedRectangle( $this->getBorder1Width(), $this->getBorder1Width(), @@ -49,28 +45,23 @@ class PMA_pChart_Pie extends PMA_pChart_Chart $this->getBgColorComp(1), $this->getBgColorComp(2) ); - echo "after drawFilledRoundedRectangle\n"; $this->chart->drawRoundedRectangle( $this->getBorder2Width(), $this->getBorder2Width(), $this->getWidth() - $this->getBorder2Width(), $this->getHeight() - $this->getBorder2Width(), 5,0,0,0); - echo "after drawRoundedRectangle\n"; - + // Draw the pie chart $this->chart->AntialiasQuality = 0; $this->chart->setShadowProperties(2,2,200,200,200); //$Test->drawFlatPieGraphWithShadow($DataSet->GetData(),$DataSet->GetDataDescription(),180,160,120,PIE_PERCENTAGE,8); //$Test->drawBasicPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),180,160,120,PIE_PERCENTAGE,255,255,218,2); $this->chart->drawPieGraph($this->dataSet->GetData(),$this->dataSet->GetDataDescription(),180,160,120,PIE_PERCENTAGE,FALSE,60,30,10,1); - echo "after drawPieGraph\n"; $this->chart->clearShadow(); $this->chart->drawTitle(20,20,$this->titleText,0,0,0); - echo "after drawTitle\n"; $this->chart->drawPieLegend(350,15,$this->dataSet->GetData(),$this->dataSet->GetDataDescription(),250,250,250); - echo "after drawPieLegend\n"; } protected function getBorder1Width()