diff --git a/public/js/gcharts.js b/public/js/gcharts.js index c51700d9b9..664859f960 100644 --- a/public/js/gcharts.js +++ b/public/js/gcharts.js @@ -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"; diff --git a/public/js/gcharts.options.js b/public/js/gcharts.options.js index 996c2849b8..54647a8e4b 100644 --- a/public/js/gcharts.options.js +++ b/public/js/gcharts.options.js @@ -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"], }; diff --git a/public/js/index.js b/public/js/index.js index e334644636..3d888458ac 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -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'); diff --git a/resources/twig/accounts/index.twig b/resources/twig/accounts/index.twig index e10a6457d3..3a373a1f1b 100644 --- a/resources/twig/accounts/index.twig +++ b/resources/twig/accounts/index.twig @@ -17,7 +17,7 @@
- {{ subTitle}} +

{{ subTitle}}

@@ -34,7 +34,9 @@
- {% include 'list/accounts.twig' %} +
+ {% include 'list/accounts.twig' %} +
diff --git a/resources/twig/index.twig b/resources/twig/index.twig index ce8a627f22..9563949094 100644 --- a/resources/twig/index.twig +++ b/resources/twig/index.twig @@ -72,12 +72,12 @@ {% if account.difference < 0 %}
-
+
{% if account.percentage <= 50 %} {{account.difference|formatAmountPlain}} {% endif %}
-
+
{% if account.percentage > 50 %} {{account.difference|formatAmountPlain}} {% endif %} @@ -86,13 +86,13 @@ {% else %}
-
+
{% if account.percentage <= 50 %} {{account.difference|formatAmountPlain}} {{account.difference|formatAmountPlain}} {% endif %}
-
+
{% if account.percentage > 50 %} {{account.difference|formatAmountPlain}} {% endif %} @@ -177,7 +177,7 @@ {% for data in transactions %}
-

{{data[1].name}} ({{ (data[1]|balance)|formatAmount }})

+

{{data[1].name}}

@@ -195,7 +195,7 @@
-
+
{% include 'list/journals-tiny.twig' with {'transactions': data[0],'account': data[1]} %}
- - - + - - - + - - - - - - - - - - - - diff --git a/tests/repositories/TagRepositoryTest.php b/tests/repositories/TagRepositoryTest.php index 455dd46498..bcd763cd00 100644 --- a/tests/repositories/TagRepositoryTest.php +++ b/tests/repositories/TagRepositoryTest.php @@ -218,9 +218,7 @@ class TagRepositoryTest extends TestCase $journal1->tags()->save($tag); - echo "\nMark 1 start.\n"; $result = $this->object->connect($journal2, $tag); - echo "\nMark 2 end.\n"; $this->assertTrue($result);