diff --git a/libraries/chart.lib.php b/libraries/chart.lib.php index 37e50997d..282387078 100644 --- a/libraries/chart.lib.php +++ b/libraries/chart.lib.php @@ -129,16 +129,16 @@ function PMA_chart_results($data, &$chartSettings, &$chartErrors = array()) // loop through the rows foreach ($data as $rowKey => $row) { + // loop through the columns in the row + foreach ($row as $valueKey => $value) { + $chartData[$valueKey][] = $value; + } + // if only one column, we need to add // placeholder data for x axis if (count($row) == 1) { $chartData[''][] = $rowKey; } - - // loop through the columns in the row - foreach ($row as $valueKey => $value) { - $chartData[$valueKey][] = $value; - } } switch ($chartSettings['type']) {