Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Bugfix for pie charts #72

Open
wants to merge 1 commit into from

1 participant

Andrew Pendleton
Andrew Pendleton

At present, pie charts with only one value use the default first color rather than the color they're supposed to; it's issue 24 in your git repo tracker. This one-line change fixes the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 24, 2010
  1. Andrew Pendleton

    Fixing a problem where pie charts with a single value use the default…

    apendleton authored
    … color rather than the specified one.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  g.pie.js
2  g.pie.js
View
@@ -20,7 +20,7 @@ Raphael.fn.g.piechart = function (cx, cy, r, values, opts) {
defcut = true;
chart.covers = covers;
if (len == 1) {
- series.push(this.circle(cx, cy, r).attr({fill: this.g.colors[0], stroke: opts.stroke || "#fff", "stroke-width": opts.strokewidth == null ? 1 : opts.strokewidth}));
+ series.push(this.circle(cx, cy, r).attr({fill: opts.colors && opts.colors[0] || this.g.colors[0], stroke: opts.stroke || "#fff", "stroke-width": opts.strokewidth == null ? 1 : opts.strokewidth}));
covers.push(this.circle(cx, cy, r).attr(this.g.shim));
total = values[0];
values[0] = {value: values[0], order: 0, valueOf: function () { return this.value; }};
Something went wrong with that request. Please try again.