From 6eef74eb4b269f75aec9a395e13990fc871a07d0 Mon Sep 17 00:00:00 2001 From: opi Date: Wed, 11 Mar 2015 09:23:12 +0100 Subject: [PATCH] Define and use 'width' variable. --- graphnion.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/graphnion.js b/graphnion.js index de1d917..77d951c 100644 --- a/graphnion.js +++ b/graphnion.js @@ -33,6 +33,7 @@ this.options.type = options.type || defaults.type; this.options.size = options.size || defaults.size; + this.options.width = options.width || (this.options.size / 5); // Radius * 10% this.options.colors = options.colors || defaults.colors; this.options.onionoo = options.onionoo; @@ -53,8 +54,8 @@ this.radius = this.options.size / 2, this.formatPercent = d3.format(".2%"); this.arc = d3.svg.arc() - .outerRadius(this.radius - (this.options.size / 10)) - .innerRadius(this.radius - (this.options.size / 4)); + .outerRadius(this.radius) + .innerRadius(this.radius - this.options.width); this.pie = d3.layout.pie() .sort(null) -- 2.39.2