mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-20 08:30:06 +00:00
First functional run of new layout.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* globals currencyCode, language, defaultPieChartOptions, defaultLineChartOptions, defaultColumnChartOptions, defaultBarChartOptions, defaultStackedColumnChartOptions, defaultComboChartOptions */
|
||||
/* globals currencyCode,defaultAreaChartOptions , language, defaultPieChartOptions, defaultLineChartOptions, defaultColumnChartOptions, defaultBarChartOptions, defaultStackedColumnChartOptions, defaultComboChartOptions */
|
||||
/* exported googleLineChart, googleBarChart, googleColumnChart, googleStackedColumnChart, googleComboChart, googlePieChart */
|
||||
var google = google || {};
|
||||
google.load('visualization', '1.1', {'packages': ['corechart', 'bar', 'line'],'language': language });
|
||||
@@ -33,6 +33,11 @@ function googleChart(chartType, URL, container, options) {
|
||||
chart = new google.visualization.LineChart(document.getElementById(container));
|
||||
options = options || defaultLineChartOptions;
|
||||
}
|
||||
if(chartType === 'area') {
|
||||
chart = new google.visualization.AreaChart(document.getElementById(container));
|
||||
options = options || defaultAreaChartOptions;
|
||||
}
|
||||
|
||||
if (chartType === 'column') {
|
||||
chart = new google.visualization.ColumnChart(document.getElementById(container));
|
||||
options = options || defaultColumnChartOptions;
|
||||
@@ -74,6 +79,11 @@ function googleLineChart(URL, container, options) {
|
||||
return googleChart('line', URL, container, options);
|
||||
}
|
||||
|
||||
function googleAreaChart(URL, container, options) {
|
||||
"use strict";
|
||||
return googleChart('area', URL, container, options);
|
||||
}
|
||||
|
||||
|
||||
function googleBarChart(URL, container, options) {
|
||||
"use strict";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* exported defaultLineChartOptions, defaultBarChartOptions, defaultComboChartOptions, defaultColumnChartOptions, defaultStackedColumnChartOptions, defaultPieChartOptions */
|
||||
/* exported defaultLineChartOptions, defaultAreaChartOptions, defaultBarChartOptions, defaultComboChartOptions, defaultColumnChartOptions, defaultStackedColumnChartOptions, defaultPieChartOptions */
|
||||
|
||||
var defaultLineChartOptions = {
|
||||
curveType: 'function',
|
||||
@@ -35,6 +35,43 @@ var defaultLineChartOptions = {
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
var defaultAreaChartOptions = {
|
||||
curveType: 'function',
|
||||
legend: {
|
||||
position: 'none'
|
||||
},
|
||||
interpolateNulls: true,
|
||||
lineWidth: 1,
|
||||
chartArea: {
|
||||
left: 50,
|
||||
top: 10,
|
||||
width: '85%',
|
||||
height: '80%'
|
||||
},
|
||||
height: 400,
|
||||
colors: ["#357ca5", "#008d4c", "#db8b0b", "#ca195a", "#555299", "#4285f4", "#db4437", "#f4b400", "#0f9d58", "#ab47bc", "#00acc1", "#ff7043", "#9e9d24", "#5c6bc0", "#f06292", "#00796b", "#c2185b"],
|
||||
hAxis: {
|
||||
textStyle: {
|
||||
color: '#838383',
|
||||
},
|
||||
baselineColor: '#aaaaaa',
|
||||
gridlines: {
|
||||
color: 'transparent'
|
||||
}
|
||||
},
|
||||
fontName: 'Roboto',
|
||||
fontSize: 11,
|
||||
vAxis: {
|
||||
textStyle: {
|
||||
color: '#838383',
|
||||
},
|
||||
baselineColor: '#aaaaaa',
|
||||
format: '\u20AC #'
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
var defaultBarChartOptions = {
|
||||
@@ -119,7 +156,7 @@ var defaultColumnChartOptions = {
|
||||
baselineColor: '#aaaaaa'
|
||||
|
||||
},
|
||||
colors: ["#4285f4", "#db4437", "#f4b400", "#0f9d58", "#ab47bc", "#00acc1", "#ff7043", "#9e9d24", "#5c6bc0", "#f06292", "#00796b", "#c2185b"],
|
||||
colors: ["#357ca5", "#008d4c", "#db8b0b", "#ca195a", "#555299", "#4285f4", "#db4437", "#f4b400", "#0f9d58", "#ab47bc", "#00acc1", "#ff7043", "#9e9d24", "#5c6bc0", "#f06292", "#00796b", "#c2185b"],
|
||||
vAxis: {
|
||||
textStyle: {
|
||||
color: '#838383',
|
||||
@@ -146,7 +183,7 @@ var defaultStackedColumnChartOptions = {
|
||||
fontName: 'Roboto',
|
||||
fontSize: 11,
|
||||
isStacked: true,
|
||||
colors: ["#4285f4", "#db4437", "#f4b400", "#0f9d58", "#ab47bc", "#00acc1", "#ff7043", "#9e9d24", "#5c6bc0", "#f06292", "#00796b", "#c2185b"],
|
||||
colors: ["#357ca5", "#008d4c", "#db8b0b", "#ca195a", "#555299", "#4285f4", "#db4437", "#f4b400", "#0f9d58", "#ab47bc", "#00acc1", "#ff7043", "#9e9d24", "#5c6bc0", "#f06292", "#00796b", "#c2185b"],
|
||||
hAxis: {
|
||||
textStyle: {
|
||||
color: '#838383',
|
||||
@@ -176,6 +213,6 @@ var defaultPieChartOptions = {
|
||||
legend: {
|
||||
position: 'none'
|
||||
},
|
||||
colors: ["#4285f4", "#db4437", "#f4b400", "#0f9d58", "#ab47bc", "#00acc1", "#ff7043", "#9e9d24", "#5c6bc0", "#f06292", "#00796b", "#c2185b"]
|
||||
colors: ["#357ca5", "#008d4c", "#db8b0b", "#ca195a", "#555299", "#4285f4", "#db4437", "#f4b400", "#0f9d58", "#ab47bc", "#00acc1", "#ff7043", "#9e9d24", "#5c6bc0", "#f06292", "#00796b", "#c2185b"],
|
||||
};
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ google.setOnLoadCallback(drawChart);
|
||||
|
||||
function drawChart() {
|
||||
"use strict";
|
||||
googleLineChart('chart/account/frontpage', 'accounts-chart');
|
||||
googleAreaChart('chart/account/frontpage', 'accounts-chart');
|
||||
googlePieChart('chart/bill/frontpage', 'bills-chart');
|
||||
googleStackedColumnChart('chart/budget/frontpage', 'budgets-chart');
|
||||
googleColumnChart('chart/category/frontpage', 'categories-chart');
|
||||
|
||||
Reference in New Issue
Block a user