Overspent transactions have a separate colour [skip ci]

This commit is contained in:
James Cole
2015-05-04 18:45:20 +02:00
parent 4660cf2ad5
commit 0205d3fc5c

View File

@@ -149,7 +149,7 @@ class GoogleChartController extends Controller
{
$chart->addColumn('Budget', 'string');
$chart->addColumn('Left', 'number');
//$chart->addColumn('Spent', 'number');
$chart->addColumn('Overspent', 'number');
$budgets = $repository->getBudgets();
$start = Session::get('start', Carbon::now()->startOfMonth());
@@ -176,7 +176,12 @@ class GoogleChartController extends Controller
foreach ($allEntries as $entry) {
if ($entry[2] > 0) {
$left = $entry[1] - $entry[2];
$chart->addRow($entry[0], $left);
if ($left >= 0) {
$chart->addRow($entry[0], $left, null);
} else {
$chart->addRow($entry[0], null, $left);
}
}
}