Commit 5b16b354 authored by Betz's avatar Betz

chart on books page; warchest update

parent 31fb3896
Pipeline #55634564 passed with stages
in 1 minute and 8 seconds
......@@ -90,4 +90,13 @@ linktitle: "HSBXL Books"
# Bank account
The [HSBXL bank account](/contact) contained on **{{< warchest date >}}** the amount of **€{{< warchest amount >}}**.
\ No newline at end of file
{{< bankaccount_graph year="2019" >}}
The [HSBXL bank account](/contact) contained on **{{< warchest date >}}** the amount of **€{{< warchest amount >}}**.
date: 2019-03-02
amount: 4761
\ No newline at end of file
date: 2019-04-07
amount: 3727.02
\ No newline at end of file
{{ $argyear := .Get "year"}}
<script type="text/javascript">
google.charts.load('current', {packages: ['corechart']});
google.charts.setOnLoadCallback(drawChart);
data = {
"generated-date-text": "Fri Apr 5 13:30:01 CEST 2019",
"generated-date-unixtime": 1554463801,
"BE60973134794870": {},
"BE69979429775578": {
"data": {
"2009": {},
"2010": {},
"2011": {},
"2012": {},
"2013": {},
"2014": {},
"2015": {},
"2016": {},
"2017": {
"January": {
"BalanceStart": 1885.54,
"BalanceEnd": 2515.23,
"Income": 629.69,
"Spending": 0,
"Trend": 629.69
},
"February": {
"BalanceStart": 2515.23,
"BalanceEnd": 3404.11,
"Income": 1965,
"Spending": -1076.12,
"Trend": 888.88
},
"March": {
"BalanceStart": 3404.11,
"BalanceEnd": 2951.54,
"Income": 1050,
"Spending": -1502.57,
"Trend": -452.57
},
"April": {
"BalanceStart": 2951.54,
"BalanceEnd": 3120.54,
"Income": 1143,
"Spending": -974,
"Trend": 169
},
"May": {
"BalanceStart": 3120.54,
"BalanceEnd": 2963.08,
"Income": 825,
"Spending": -982.46,
"Trend": -157.46
},
"June": {
"BalanceStart": 2963.08,
"BalanceEnd": 2839.07,
"Income": 850,
"Spending": -974.01,
"Trend": -124.01
},
"July": {
"BalanceStart": 2839.07,
"BalanceEnd": 1635.1,
"Income": 900,
"Spending": -2103.97,
"Trend": -1203.97
},
"August": {
"BalanceStart": 1635.1,
"BalanceEnd": 2683.1,
"Income": 1048,
"Spending": 0,
"Trend": 1048
},
"September": {
"BalanceStart": 2683.1,
"BalanceEnd": 2437.27,
"Income": 1016,
"Spending": -1261.83,
"Trend": -245.83
},
"October": {
"BalanceStart": 2437.27,
"BalanceEnd": 2775.33,
"Income": 2238.06,
"Spending": -1900,
"Trend": 338.06
},
"November": {
"BalanceStart": 2775.33,
"BalanceEnd": 2882.53,
"Income": 930.5,
"Spending": -823.3,
"Trend": 107.2
},
"December": {
"BalanceStart": 2882.53,
"BalanceEnd": 3190.03,
"Income": 1207.5,
"Spending": -900,
"Trend": 307.5
}
},
"2018": {
"January": {
"BalanceStart": 3190.03,
"BalanceEnd": 2955.03,
"Income": 815,
"Spending": -1050,
"Trend": -235
},
"February": {
"BalanceStart": 2955.03,
"BalanceEnd": 3832.01,
"Income": 2790,
"Spending": -1913.02,
"Trend": 876.98
},
"March": {
"BalanceStart": 3832.01,
"BalanceEnd": 4842.14,
"Income": 1227.5,
"Spending": -217.37,
"Trend": 1010.13
},
"April": {
"BalanceStart": 4842.14,
"BalanceEnd": 4549.23,
"Income": 1227.09,
"Spending": -1520,
"Trend": -292.91
},
"May": {
"BalanceStart": 4549.23,
"BalanceEnd": 4388.95,
"Income": 960.23,
"Spending": -1120.51,
"Trend": -160.28
},
"June": {
"BalanceStart": 4388.95,
"BalanceEnd": 3710.27,
"Income": 1223,
"Spending": -1901.68,
"Trend": -678.68
},
"July": {
"BalanceStart": 3710.27,
"BalanceEnd": 3540.27,
"Income": 780,
"Spending": -950,
"Trend": -170
},
"August": {
"BalanceStart": 3540.27,
"BalanceEnd": 3890.27,
"Income": 1300,
"Spending": -950,
"Trend": 350
},
"September": {
"BalanceStart": 3890.27,
"BalanceEnd": 4025.89,
"Income": 1284.54,
"Spending": -1148.92,
"Trend": 135.62
},
"October": {
"BalanceStart": 4025.89,
"BalanceEnd": 2727.29,
"Income": 972.5,
"Spending": -2271.1,
"Trend": -1298.6
},
"November": {
"BalanceStart": 2727.29,
"BalanceEnd": 3131.61,
"Income": 1674,
"Spending": -1269.68,
"Trend": 404.32
},
"December": {
"BalanceStart": 3131.61,
"BalanceEnd": 3121.61,
"Income": 840,
"Spending": -850,
"Trend": -10
}
},
"2019": {
"January": {
"BalanceStart": 3121.61,
"BalanceEnd": 2245.47,
"Income": 870,
"Spending": -1746.14,
"Trend": -876.14
},
"February": {
"BalanceStart": 2245.47,
"BalanceEnd": 4621.5,
"Income": 3802,
"Spending": -1425.97,
"Trend": 2376.03
},
"March": {
"BalanceStart": 4621.5,
"BalanceEnd": 4039.38,
"Income": 1143.8,
"Spending": -1725.92,
"Trend": -582.12
},
"April": {
"BalanceStart": 4039.38,
"BalanceEnd": 3697.02,
"Income": 320,
"Spending": -662.36,
"Trend": -342.36
}
}
}
}
};
var balance = [
['Month', 'Income', 'Spending']
];
$.each( data['BE69979429775578'].data['{{ $argyear }}'], function( key, val ) {
console.log(key);
console.log(val);
balance.push([key, val.Income, Math.abs(val.Spending)]);
});
console.log(balance);
function drawChart() {
var data = google.visualization.arrayToDataTable(balance);
var options = {
title: 'Company Performance',
curveType: 'function',
legend: { position: 'bottom' }
};
// Instantiate and draw the chart.
var chart = new google.visualization.LineChart(document.getElementById('chart{{ $argyear }}'));
var options = {
'title':'Income and spending in {{ $argyear }}',
'height':200,
'backgroundColor': { fill:'transparent' },
'legendTextStyle': { color: '#839496' },
'titleTextStyle': { color: '#839496' },
'hAxis': {
textStyle: {
color: "#839496"
},
gridlines: {
color: "#839496"
},
baselineColor: '#839496'
},
};
chart.draw(data, options);
}
</script>
<div id="chart{{ $argyear }}" /></div>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment