diff --git a/libraries/chart.lib.php b/libraries/chart.lib.php index 5e52e6a7f..eeebd9fde 100644 --- a/libraries/chart.lib.php +++ b/libraries/chart.lib.php @@ -99,7 +99,7 @@ function PMA_chart_results($data, &$chartSettings, &$chartErrors = array()) return __('No data found for the chart.'); } - if (count($data[0]) == 1 || count($data[0] == 2)) { + if (count($data[0]) == 1 || count($data[0]) == 2) { // Two columns in every row. // This data is suitable for a simple bar chart. @@ -113,7 +113,7 @@ function PMA_chart_results($data, &$chartSettings, &$chartErrors = array()) $chartData[$rowKey] = $values[0]; } else { - $chartData[$values[0]] = $values[1]; + $chartData[$values[1]] = $values[0]; } } @@ -156,8 +156,8 @@ function PMA_chart_results($data, &$chartSettings, &$chartErrors = array()) $chartSettings['multi'] = true; $keys = array_keys($data[0]); - $xAxisKey = $keys[0]; - $yAxisKey = $keys[1]; + $yAxisKey = $keys[0]; + $xAxisKey = $keys[1]; $seriesKey = $keys[2]; // get all the series labels diff --git a/libraries/chart/pma_pchart_single.php b/libraries/chart/pma_pchart_single.php index d6d4c34c2..d89c59646 100644 --- a/libraries/chart/pma_pchart_single.php +++ b/libraries/chart/pma_pchart_single.php @@ -18,8 +18,8 @@ abstract class PMA_pChart_single extends PMA_pChart_chart $keys = array_keys($this->data); // Dataset definition - $this->dataSet->AddPoint($values[1], "Values"); - $this->dataSet->AddPoint($values[0], "Keys"); + $this->dataSet->AddPoint($values[0], "Values"); + $this->dataSet->AddPoint($values[1], "Keys"); //$this->dataSet->AddAllSeries(); $this->dataSet->AddSerie("Values"); diff --git a/libraries/chart/pma_pchart_single_radar.php b/libraries/chart/pma_pchart_single_radar.php index b1c017e32..f75b24bb4 100644 --- a/libraries/chart/pma_pchart_single_radar.php +++ b/libraries/chart/pma_pchart_single_radar.php @@ -18,7 +18,7 @@ class PMA_pChart_single_radar extends PMA_pChart_single { $maxValue = 0; $keys = array_keys($this->data); - $valueKey = $keys[1]; + $valueKey = $keys[0]; $maxValue = max($this->data[$valueKey]); foreach ($this->data[$valueKey] as &$value) {