diff --git a/libraries/chart/pma_pchart_chart.php b/libraries/chart/pma_pchart_chart.php
index 57f10fd69..e9485fca1 100644
--- a/libraries/chart/pma_pchart_chart.php
+++ b/libraries/chart/pma_pchart_chart.php
@@ -38,7 +38,10 @@ abstract class PMA_pChart_Chart extends PMA_Chart
// as in CSS (top, right, bottom, left)
$this->setAreaMargins(array(20, 20, 40, 60));
+ }
+ protected function init()
+ {
// create pChart object
$this->chart = new pChart($this->getWidth(), $this->getHeight());
@@ -54,6 +57,8 @@ abstract class PMA_pChart_Chart extends PMA_Chart
hexdec(substr($color, 5, 2))
);
}
+
+ $this->chart->setFontProperties($this->getFontPath().'tahoma.ttf', 8);
}
abstract protected function prepareDataSet();
@@ -74,7 +79,6 @@ abstract class PMA_pChart_Chart extends PMA_Chart
protected function drawCommon()
{
- $this->chart->setFontProperties($this->getFontPath().'tahoma.ttf', 8);
$this->chart->drawGraphAreaGradient(
$this->getBgColor(RED),
$this->getBgColor(GREEN),
@@ -122,14 +126,15 @@ abstract class PMA_pChart_Chart extends PMA_Chart
public function toString()
{
if (function_exists('gd_info')) {
+ $this->init();
$this->prepareDataSet();
$this->prepareChart();
$this->render();
- return '
';
+ return '
';
}
else {
- return 'Missing GD library.';
+ return __('GD library needed for chart is missing.');
}
}
diff --git a/libraries/chart/pma_pchart_single_bar.php b/libraries/chart/pma_pchart_single_bar.php
index 1005a1ea5..024826af7 100644
--- a/libraries/chart/pma_pchart_single_bar.php
+++ b/libraries/chart/pma_pchart_single_bar.php
@@ -13,8 +13,6 @@ class PMA_pChart_single_bar extends PMA_pChart_single
{
// Draw the bar chart
$this->chart->drawStackedBarGraph($this->dataSet->GetData(),$this->dataSet->GetDataDescription(),70);
- //$this->chart->drawLineGraph($this->dataSet->GetData(),$this->dataSet->GetDataDescription());
- //$this->chart->drawPlotGraph($this->dataSet->GetData(),$this->dataSet->GetDataDescription(),4,2,-1,-1,-1,TRUE);
}
}