Upgrade chart library.

This commit is contained in:
James Cole
2016-04-10 10:05:50 +02:00
parent d5d4bb2c4b
commit b74c1c8cf9
15 changed files with 201 additions and 125 deletions

View File

@@ -31,18 +31,15 @@ class ChartJsBillChartGenerator implements BillChartGeneratorInterface
public function frontpage(string $paid, string $unpaid): array
{
$data = [
[
'value' => round($unpaid, 2),
'color' => 'rgba(53, 124, 165,0.7)',
'highlight' => 'rgba(53, 124, 165,0.9)',
'label' => trans('firefly.unpaid'),
],
[
'value' => round(bcmul($paid, '-1'), 2), // paid is negative, must be positive.
'color' => 'rgba(0, 141, 76, 0.7)',
'highlight' => 'rgba(0, 141, 76, 0.9)',
'label' => trans('firefly.paid'),
'datasets' => [
[
'data' => [round($unpaid, 2), round(bcmul($paid, '-1'), 2)],
'backgroundColor' => ['rgba(53, 124, 165,0.7)', 'rgba(0, 141, 76, 0.7)',],
],
],
'labels' => [strval(trans('firefly.unpaid')), strval(trans('firefly.paid'))],
];
return $data;

View File

@@ -89,7 +89,7 @@ class ChartJsReportChartGenerator implements ReportChartGeneratorInterface
'labels' => [],
'datasets' => [
[
'label' => trans('firefly.net-worth'),
'label' => trans('firefly.net_worth'),
'data' => [],
],
],