Simplified some code.

This commit is contained in:
James Cole
2016-01-02 16:32:08 +01:00
parent 265dd37212
commit 294df4a2b3
5 changed files with 106 additions and 150 deletions

View File

@@ -100,9 +100,9 @@ class ChartJsCategoryChartGenerator implements CategoryChartGenerator
],
];
foreach ($entries as $entry) {
if ($entry['sum'] != 0) {
$data['labels'][] = $entry['name'];
$data['datasets'][0]['data'][] = round(($entry['sum'] * -1), 2);
if ($entry->spent != 0) {
$data['labels'][] = $entry->name;
$data['datasets'][0]['data'][] = round(($entry->spent * -1), 2);
}
}