2 /* vim: set expandtab sw=4 ts=4 sts=4: */
10 require_once 'pma_pchart_chart.php';
13 * Base class for every chart that uses only one series.
17 abstract class PMA_pChart_single
extends PMA_pChart_chart
19 public function __construct($data, $options = null)
21 parent
::__construct($data, $options);
25 * data set preparation for single serie charts
27 protected function prepareDataSet()
29 $values = array_values($this->data
);
30 $keys = array_keys($this->data
);
33 $this->dataSet
->AddPoint($values[0], "Values");
34 $this->dataSet
->AddPoint($values[1], "Keys");
36 //$this->dataSet->AddAllSeries();
37 $this->dataSet
->AddSerie("Values");
39 $this->dataSet
->SetAbsciseLabelSerie("Keys");
41 $yLabel = $this->getYLabel();
43 $this->setYLabel($keys[0]);
45 $xLabel = $this->getXLabel();
47 $this->setXLabel($keys[1]);
50 $this->dataSet
->SetXAxisName($this->getXLabel());
51 $this->dataSet
->SetYAxisName($this->getYLabel());
52 $this->dataSet
->SetSerieName($this->getYLabel(), "Values");