summaryrefslogtreecommitdiff
path: root/static/js/kosten.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--static/js/kosten.js47
1 files changed, 46 insertions, 1 deletions
diff --git a/static/js/kosten.js b/static/js/kosten.js
index c1df1ca..279f351 100644
--- a/static/js/kosten.js
+++ b/static/js/kosten.js
@@ -29,7 +29,52 @@
}
return $(this).nextAll('.details:first').toggle();
});
- return $('.details').hide();
+ $('.details').hide();
+ return $('.pie').each(function(){
+ var x$, k, v;
+ x$ = $(this);
+ x$.highcharts({
+ title: {
+ text: null
+ },
+ tooltip: {
+ hideDelay: 200,
+ formatter: function(){
+ return this.key + ": <b>" + this.y.toFixed(2) + " €</b> / " + this.percentage.toFixed(2) + "%";
+ }
+ },
+ chart: {
+ backgroundColor: null,
+ plotBorderWidth: null,
+ plotShadow: false,
+ margin: [0, 0, 0, 0]
+ },
+ credits: {
+ enabled: false
+ },
+ series: [{
+ type: 'pie',
+ size: '50%',
+ allowPointSelect: true,
+ dataLabels: {
+ color: x$.css('color')
+ },
+ data: (function(){
+ var ref$, results$ = [];
+ for (k in ref$ = x$.data('pie')) {
+ v = ref$[k];
+ results$.push({
+ name: v > 0 ? k : '',
+ y: v,
+ visible: v > 0
+ });
+ }
+ return results$;
+ }())
+ }]
+ });
+ return x$;
+ });
});
out$.catsJS = catsJS = jq(function(){
var counter, add_img, new_input, new_image;