This commit is contained in:
James Cole
2019-12-20 17:28:49 +01:00
parent cc936e68f2
commit 7431e18e4b
2 changed files with 18 additions and 1 deletions

View File

@@ -33,7 +33,8 @@ var fixHelper = function (e, tr) {
$(function () {
"use strict";
lineChart(chartUri, 'overview-chart');
//lineChart(chartUri, 'overview-chart');
lineNoStartZeroChart(chartUri, 'overview-chart');
if (!showAll) {
multiCurrencyPieChart(incomeCategoryUri, 'account-cat-in');
multiCurrencyPieChart(expenseCategoryUri, 'account-cat-out');

View File

@@ -92,6 +92,22 @@ function lineChart(URI, container) {
drawAChart(URI, container, chartType, options, colorData);
}
/**
* Function to draw a line chart that doesn't start at ZERO.
* @param URI
* @param container
*/
function lineNoStartZeroChart(URI, container) {
"use strict";
var colorData = true;
var options = $.extend(true, {}, defaultChartOptions);
var chartType = 'line';
options.scales.yAxes[0].ticks.beginAtZero = false;
drawAChart(URI, container, chartType, options, colorData);
}
/**
* Overrules the currency the line chart is drawn in.
*