Permalink
Browse files

Fix to issue #4 (href issue, where ordered list of href's is not foll…

…owed. Only fixes issue #4 specifically - i.e. doesn't include color fix.

Identified by tbritt in issues post but did not appear to be forked.
  • Loading branch information...
1 parent c3cb50e commit 85c6bf70bcb240489387a5f67e21ea30d8621cae @collymitch committed Sep 13, 2011
Showing with 5 additions and 3 deletions.
  1. +5 −3 g.pie.js
View
@@ -78,9 +78,11 @@ Raphael.fn.g.piechart = function (cx, cy, r, values, opts) {
series.push(p);
opts.init && p.animate({path: path.join(",")}, (+opts.init - 1) || 1000, ">");
}
- for (i = 0; i < len; i++) {
- p = paper.path(sectors[i].attr("path")).attr(this.g.shim);
- opts.href && opts.href[i] && p.attr({href: opts.href[i]});
+ // fix to issue #4, code courtesy of tbritt, applied by Collymitch
+ for (var i = 0; i < len; i++) {
+ var optsIndex = values[i].order;
+ var p = paper.path(sectors[i].attr("path")).attr(this.g.shim);
+ opts.href && opts.href[optsIndex] && p.attr({href: opts.href[optsIndex]});
p.attr = function () {};
covers.push(p);
series.push(p);

0 comments on commit 85c6bf7

Please sign in to comment.