diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2013-09-14 23:05:07 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2013-09-14 23:05:07 +0200 |
commit | 43459025bcac72318e4ef8a32c2d4455321bc191 (patch) | |
tree | df364532e6b3526319ff916af7a687e28d89773b /static/js/kosten.ls | |
parent | 8a1c2eab6d70bb6b8c3f49cbe49247f6934066ed (diff) | |
download | kosten-43459025bcac72318e4ef8a32c2d4455321bc191.tar.gz kosten-43459025bcac72318e4ef8a32c2d4455321bc191.tar.bz2 kosten-43459025bcac72318e4ef8a32c2d4455321bc191.zip |
Draw pies using highcharts JS-lib
Diffstat (limited to 'static/js/kosten.ls')
-rw-r--r-- | static/js/kosten.ls | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/static/js/kosten.ls b/static/js/kosten.ls index 8bf746d..fa96f4a 100644 --- a/static/js/kosten.ls +++ b/static/js/kosten.ls @@ -24,6 +24,31 @@ export showJS = jq -> $ \.details .hide! + # draw the pies + <- $ \.pie .each + $ @ + ..highcharts do + title: text: null + tooltip: + hideDelay: 200 + formatter: -> + "#{@key}: <b>#{@y.toFixed 2} €</b> / #{@percentage.toFixed 2}%" + chart: + backgroundColor: null + plotBorderWidth: null + plotShadow: off + margin: [0,0,0,0] + credits: enabled: false + series: [ + type: \pie + size: \50% + allowPointSelect: true + dataLabels: + color: ..css \color + data: [ {name: if v>0 then k else '' , y: v, visible: v > 0} \ + for k,v of ..data \pie ] + ] + # Categories export catsJS = jq -> counter = 0 |