From d051dfe47fe422ea9c40b73695e3ccdf9ba6c511 Mon Sep 17 00:00:00 2001 From: Ben Dixon Date: Thu, 15 Jan 2015 13:40:08 -0600 Subject: [PATCH] handling negative values in doughnut charts --- src/Chart.Doughnut.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Chart.Doughnut.js b/src/Chart.Doughnut.js index 35de93c7f..a892b0efc 100644 --- a/src/Chart.Doughnut.js +++ b/src/Chart.Doughnut.js @@ -109,12 +109,12 @@ } }, calculateCircumference : function(value){ - return (Math.PI*2)*(value / this.total); + return (Math.PI*2)*(Math.abs(value) / this.total); }, calculateTotal : function(data){ this.total = 0; helpers.each(data,function(segment){ - this.total += segment.value; + this.total += Math.abs(segment.value); },this); }, update : function(){