]> nos-oignons.net Git - graphnion.git/commitdiff
Define and use 'width' variable.
authoropi <opi@no-log.org>
Wed, 11 Mar 2015 08:23:12 +0000 (09:23 +0100)
committeropi <opi@no-log.org>
Wed, 11 Mar 2015 08:23:12 +0000 (09:23 +0100)
graphnion.js

index de1d9177f6808ca2664111cabe1b4195e0b75bc0..77d951c5a4ed31d2e0c75b112f9ffefa89be9bf4 100644 (file)
@@ -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)