Fix negative amounts and chart names.

This commit is contained in:
James Cole
2015-12-27 21:26:44 +01:00
parent 15846e157b
commit 18c46df9aa
2 changed files with 5 additions and 6 deletions

View File

@@ -83,8 +83,8 @@ class ChartJsBudgetChartGenerator implements BudgetChartGenerator
if ($entry[1] != 0 || $entry[2] != 0 || $entry[3] != 0) {
$data['labels'][] = $entry[0];
$left[] = round($entry[1], 2);
$spent[] = round($entry[2], 2);
$overspent[] = round($entry[3], 2);
$spent[] = round($entry[2] * -1, 2); // spent is coming in negative, must be positive
$overspent[] = round($entry[3] * -1, 2); // same
}
}