From 91f69a2754b38ea4583ef240f589d4da97f55c9d Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Thu, 28 Aug 2014 00:55:22 +0200 Subject: Add clickable stat points --- static/js/kosten.ls | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'static/js/kosten.ls') diff --git a/static/js/kosten.ls b/static/js/kosten.ls index dea12f3..01bc10c 100644 --- a/static/js/kosten.ls +++ b/static/js/kosten.ls @@ -76,6 +76,16 @@ export statJS = jq -> month = 30d * 24h * 60min * 60s * 1000ms + const-dialog = !-> + df = Highcharts.date-format + diag_opts = + #title: "Konstante Ausgaben #{df '%b %Y' @x}" + title: df '%B %Y' @x + + data <-! $.get df '/stats/_const/%Y/%d' @x + $ data .dialog diag_opts + + <- $ \.stats .each $ @ ..highcharts 'StockChart' do @@ -83,15 +93,17 @@ export statJS = jq -> credits: enabled: false range-selector: buttons: [] - input-date-format: "%d. %b %Y" - input-edit-date-format: "%d.%m.%Y" + input-date-format: "%b %Y" + input-edit-date-format: "%m.%Y" input-date-parser: (value) -> value .= split /\./ - Date.UTC value[2], # year - value[1] - 1, # month ... 0-based -.- - value[0], #day + Date.UTC value[1], # year + value[0] - 1, # month ... 0-based -.- + 1, #day 0,0,0,0 # time - + plot-options: + series: + point: events: click: const-dialog x-axis: min-tick-interval: month min-range: month @@ -99,7 +111,7 @@ export statJS = jq -> data : ..data \stats ] tooltip: - point-format: "{point.y} €
" + point-format: '{point.y} €
' # Categories -- cgit v1.2.3-54-g00ecf