mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-03 03:00:14 +00:00
Budget chart.
This commit is contained in:
@@ -132,6 +132,54 @@ function doubleYChart(URI, container) {
|
||||
drawAChart(URI, container, chartType, options, colorData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to draw a chart with double Y Axes and non stacked columns.
|
||||
*
|
||||
* @param URI
|
||||
* @param container
|
||||
*/
|
||||
function doubleYNonStackedChart(URI, container) {
|
||||
"use strict";
|
||||
|
||||
var colorData = true;
|
||||
var options = defaultChartOptions;
|
||||
options.scales.yAxes = [
|
||||
// y axis 0:
|
||||
{
|
||||
display: true,
|
||||
ticks: {
|
||||
callback: function (tickValue, index, ticks) {
|
||||
"use strict";
|
||||
return accounting.formatMoney(tickValue);
|
||||
|
||||
},
|
||||
beginAtZero: true
|
||||
},
|
||||
position: "left",
|
||||
"id": "y-axis-0"
|
||||
},
|
||||
// and y axis 1:
|
||||
{
|
||||
display: true,
|
||||
ticks: {
|
||||
callback: function (tickValue, index, ticks) {
|
||||
"use strict";
|
||||
return accounting.formatMoney(tickValue);
|
||||
|
||||
},
|
||||
beginAtZero: true
|
||||
},
|
||||
position: "right",
|
||||
"id": "y-axis-1"
|
||||
}
|
||||
|
||||
];
|
||||
var chartType = 'bar';
|
||||
|
||||
drawAChart(URI, container, chartType, options, colorData);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -28,7 +28,7 @@ function drawChart() {
|
||||
"use strict";
|
||||
|
||||
// month view:
|
||||
stackedColumnChart(mainUri, 'in-out-chart');
|
||||
doubleYNonStackedChart(mainUri, 'in-out-chart');
|
||||
|
||||
// draw pie chart of income, depending on "show other transactions too":
|
||||
redrawPieChart('budgets-out-pie-chart', budgetExpenseUri);
|
||||
|
Reference in New Issue
Block a user