Skip to content
This repository

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

Showing 1 unique commit by 1 author.

Sep 24, 2010
Andrew Pendleton apendleton Fixing a problem where pie charts with a single value use the default…
… color rather than the specified one.
d857d8e
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  g.pie.js
2  g.pie.js
@@ -20,7 +20,7 @@ Raphael.fn.g.piechart = function (cx, cy, r, values, opts) {
20 20 defcut = true;
21 21 chart.covers = covers;
22 22 if (len == 1) {
23   - 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}));
  23 + 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}));
24 24 covers.push(this.circle(cx, cy, r).attr(this.g.shim));
25 25 total = values[0];
26 26 values[0] = {value: values[0], order: 0, valueOf: function () { return this.value; }};

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.