diff --git a/g.pie.js b/g.pie.js index 82c906b..44191cc 100644 --- a/g.pie.js +++ b/g.pie.js @@ -29,6 +29,7 @@ o init (boolean) whether or not to show animation when the chart is ready [default `false`] o colors (array) colors be used to plot the chart o href (array) urls to to set up clicks on chart slices + o matchColors (boolean) is colors-array matched with legends-array [default: `false`] o legend (array) array containing strings that will be used in a legend. Other label options work if legend is defined. o legendcolor (string) color of text in legend [default `"#000"`] o legendothers (string) text that will be used in legend to describe options that are collapsed into 1 slice, because they are too small to render [default `"Others"`] @@ -131,7 +132,7 @@ var path = sector(cx, cy, r, angle, angle -= 360 * values[i] / total); var j = (opts.matchColors && opts.matchColors == true) ? values[i].order : i; - var p = paper.path(opts.init ? ipath : path).attr({ fill: opts.colors && opts.colors[j] || chartinst.colors[j] || "#666", stroke: opts.stroke || "#fff", "stroke-width": (opts.strokewidth == null ? 1 : opts.strokewidth), "stroke-linejoin": "round" }); + var p = paper.path(opts.init ? ipath : path).attr({ fill: opts.colors && opts.colors[j] || chartinst.colors[i] || "#666", stroke: opts.stroke || "#fff", "stroke-width": (opts.strokewidth == null ? 1 : opts.strokewidth), "stroke-linejoin": "round" }); p.value = values[i]; p.middle = path.middle; @@ -293,4 +294,4 @@ return new Piechart(this, cx, cy, r, values, opts); } -})(); \ No newline at end of file +})();