added configurable settings for title and labels
This commit is contained in:
@@ -50,6 +50,16 @@ class PMA_Chart
|
||||
* The height of the chart.
|
||||
*/
|
||||
'height' => 325,
|
||||
|
||||
/*
|
||||
* Default X Axis label. If empty, label will be taken from the data.
|
||||
*/
|
||||
'xLabel' => '',
|
||||
|
||||
/*
|
||||
* Default Y Axis label. If empty, label will be taken from the data.
|
||||
*/
|
||||
'yLabel' => '',
|
||||
);
|
||||
|
||||
function __construct($options = null)
|
||||
@@ -98,6 +108,16 @@ class PMA_Chart
|
||||
return hexdec(substr($this->settings['bgColor'], ($component * 2) + 1, 2));
|
||||
}
|
||||
|
||||
function getXLabel()
|
||||
{
|
||||
return $this->settings['xLabel'];
|
||||
}
|
||||
|
||||
function getYLabel()
|
||||
{
|
||||
return $this->settings['yLabel'];
|
||||
}
|
||||
|
||||
function getSettings()
|
||||
{
|
||||
return $this->settings;
|
||||
|
@@ -31,8 +31,18 @@ class PMA_pChart_bar extends PMA_pChart_Chart
|
||||
$this->dataSet->AddAllSeries();
|
||||
//$DataSet->RemoveSerie("Serie3");
|
||||
$this->dataSet->SetAbsciseLabelSerie("Keys");
|
||||
$this->dataSet->SetXAxisName($keys[0]);
|
||||
$this->dataSet->SetYAxisName($keys[1]);
|
||||
|
||||
$xLabel = $this->getXLabel();
|
||||
if (empty($xLabel)) {
|
||||
$xLabel = $keys[0];
|
||||
}
|
||||
$this->dataSet->SetXAxisName($xLabel);
|
||||
|
||||
$yLabel = $this->getYLabel();
|
||||
if (empty($yLabel)) {
|
||||
$yLabel = $keys[1];
|
||||
}
|
||||
$this->dataSet->SetYAxisName($yLabel);
|
||||
//$DataSet->SetYAxisUnit("°C");
|
||||
//$DataSet->SetXAxisUnit("h");
|
||||
}
|
||||
|
Reference in New Issue
Block a user