Skip to content

fixing bug "pie char is not shown when only one option has votes" - #144

Open
flecox wants to merge 3 commits into
DmitryBaranovskiy:masterfrom
flecox:master
Open

fixing bug "pie char is not shown when only one option has votes"#144
flecox wants to merge 3 commits into
DmitryBaranovskiy:masterfrom
flecox:master

Conversation

@flecox

@flecox flecox commented Mar 15, 2012

Copy link
Copy Markdown

the problem was.. when we have more than one option and all votes are in only one of them.
the scripts tries to draw an arc using paper.path.. starting at a position and ending at the same position,
because the positions are the same this doesn't draw anything.

so I've added a fix..

if the option 's value is equal to the total then draw a circle.

I've also minified the file

regards

@davidgoli

Copy link
Copy Markdown

+1

@blackwatertepes

Copy link
Copy Markdown

I've added a fix in issue #156, which removes the stroke from the sectors valued at 0

@ghost ghost assigned karolk Aug 16, 2012
Comment thread g.pie.js

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should be:
var circle = paper.circle(cx, cy, r).attr({ fill: opts.colors && opts.colors[i] || chartinst.colors[i], stroke: opts.stroke || "#fff", "stroke-width": opts.strokewidth == null ? 1 : opts.strokewidth });

Otherwise you're not getting the colors set up in options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants