From 9771a7352e0eafb8ed011f1bee98a537e23ebaa5 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Sun, 1 May 2016 14:36:48 +0200 Subject: Add normale expenses to stats-page --- static/js/kosten.js | 54 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 14 deletions(-) (limited to 'static/js/kosten.js') diff --git a/static/js/kosten.js b/static/js/kosten.js index a1c30fb..936e38c 100644 --- a/static/js/kosten.js +++ b/static/js/kosten.js @@ -1,4 +1,4 @@ -// Generated by LiveScript 1.2.0 +// Generated by LiveScript 1.4.0 (function(){ var jq, setLang, extendDate, addJS, showJS, statJS, catsJS, out$ = typeof exports != 'undefined' && exports || this; jQuery.fn.extend({ @@ -135,12 +135,12 @@ }); }); out$.statJS = statJS = jq(function(){ - var month, constDialog; + var df, month, constDialog; setLang(); + df = Highcharts.dateFormat; month = 30 * 24 * 60 * 60 * 1000; constDialog = function(){ - var df, time; - df = Highcharts.dateFormat; + var time; time = this.x; $.get(df('/stats/_const/%Y/%m', time), function(data){ $(data).dialog({ @@ -169,11 +169,7 @@ }, plotOptions: { series: { - point: { - events: { - click: constDialog - } - } + stacking: 'normal' } }, chart: { @@ -194,12 +190,42 @@ minTickInterval: month, minRange: month }, - series: [{ - data: x$.data('stats'), - step: 'left' - }], + yAxis: { + reversedStacks: false, + tickInterval: 250 + }, + series: [ + { + data: x$.data('consts'), + step: 'left', + name: 'Konstant', + point: { + events: { + click: constDialog + } + } + }, { + data: x$.data('expenses'), + name: 'Variabel', + step: 'left' + } + ], tooltip: { - pointFormat: '{point.y} €
' + shared: true, + formatter: function(){ + var header, body, p, footer; + header = "" + df('%B %Y', this.x) + "
"; + body = (function(){ + var i$, ref$, len$, results$ = []; + for (i$ = 0, len$ = (ref$ = this.points).length; i$ < len$; ++i$) { + p = ref$[i$]; + results$.push(p.series.name + ": " + p.point.y + " €
"); + } + return results$; + }.call(this)).join(''); + footer = "Summe: " + this.points[0].total + ""; + return header + body + footer; + } } }); }); -- cgit v1.2.3-54-g00ecf