From: opi Date: Wed, 11 Mar 2015 08:23:12 +0000 (+0100) Subject: Define and use 'width' variable. X-Git-Url: https://nos-oignons.net/gitweb/graphnion.git/commitdiff_plain/6eef74eb4b269f75aec9a395e13990fc871a07d0 Define and use 'width' variable. --- 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)