Make chart pretty

This commit is contained in:
James Cole 2016-04-10 17:03:36 +02:00
parent b062222c45
commit ab523b6102
2 changed files with 8 additions and 1 deletions

View File

@ -74,14 +74,17 @@ class ChartJsBillChartGenerator implements BillChartGeneratorInterface
} }
$data['datasets'][] = [ $data['datasets'][] = [
'type' => 'bar',
'label' => trans('firefly.minAmount'), 'label' => trans('firefly.minAmount'),
'data' => $minAmount, 'data' => $minAmount,
]; ];
$data['datasets'][] = [ $data['datasets'][] = [
'type' => 'line',
'label' => trans('firefly.billEntry'), 'label' => trans('firefly.billEntry'),
'data' => $actualAmount, 'data' => $actualAmount,
]; ];
$data['datasets'][] = [ $data['datasets'][] = [
'type' => 'bar',
'label' => trans('firefly.maxAmount'), 'label' => trans('firefly.maxAmount'),
'data' => $maxAmount, 'data' => $maxAmount,
]; ];

View File

@ -160,6 +160,11 @@ var defaultColumnOptions = {
} }
}] }]
}, },
elements: {
line: {
fill: false
}
},
tooltips: { tooltips: {
mode: 'label', mode: 'label',
callbacks: { callbacks: {
@ -302,7 +307,6 @@ function columnChart(URL, container, options) {
dataset.backgroundColor = fillColors[i]; dataset.backgroundColor = fillColors[i];
newData.datasets.push(dataset); newData.datasets.push(dataset);
} }
//new Chart(ctx).Bar(newData, defaultColumnOptions);
new Chart(ctx, { new Chart(ctx, {
type: 'bar', type: 'bar',
data: data, data: data,