It is currently Sat Oct 25, 2014 8:12 pm Advanced search

Pie Charts with Min 0

Technical support, bug reports and more.

Pie Charts with Min 0

Postby GWoodburn » Tue Feb 14, 2012 7:29 pm

I have a pie chart that has the may at times have values less that 0. I've tried setting min: 0 on the yAxis but this doesn't seem to prevent those values from either showing or being pinned to 0 rather than negative. Have the negative value in the chart is doing some really funky thinks. Is there a fix for this that I am missing?
GWoodburn
 
Posts: 13
Joined: Wed Feb 01, 2012 8:17 am

Re: Pie Charts with Min 0

Postby Fusher » Thu Feb 16, 2012 2:18 pm

Can't you preprocess data for series? For example: http://www.highcharts.com/jsbin/oqaveg/edit
Paweł Fus
Highcharts support team
Fusher
 
Posts: 7388
Joined: Mon Jan 30, 2012 12:16 pm

Re: Pie Charts with Min 0

Postby jlbriggs » Thu Feb 16, 2012 5:16 pm

On a different note - if you have negative values, the whole point of a pie chart is completely lost.
A pie chart is generally a poor choice of a method to display data anyway, but when you take away the one thing that it does (represent all the parts of a whole), it doesn't make sense.
I would highly recommend using a bar chart instead :)

FWIW
fiddles: http://jsfiddle.net/jlbriggs/J9JLr/
jlbriggs
 
Posts: 1458
Joined: Tue Sep 21, 2010 4:33 pm

Re: Pie Charts with Min 0

Postby GWoodburn » Sat Feb 18, 2012 1:04 am

Fusher, I ended up preprocessing the values with less than 0 out of the series. I had just thought that the min: 0 value would set any negative values to 0.

jlbriggs, obviously i didn't want to display negative value. Hense the post here. We are showing the total amount of spend for a client (credit != spend ). So getting rid of the negative value makes the pie chart very helpful in our case.
GWoodburn
 
Posts: 13
Joined: Wed Feb 01, 2012 8:17 am

Re: Pie Charts with Min 0

Postby jlbriggs » Sat Feb 18, 2012 2:41 pm

Obviously you need to use whatever chart that you see fit to use, but I think you missed my point.
Clearly you can't display negative values on a pie chart.
The point is that a pie chart is designed, however poorly, to display all the parts of a whole, and their percentage of that whole.
If you have data with negative values, even if you exclude those data points, the data is not fit to display in this manner as it is not representing a whole at all, and a bar chart is the more logical way to go.

Again - FWIW
Just an observation.
fiddles: http://jsfiddle.net/jlbriggs/J9JLr/
jlbriggs
 
Posts: 1458
Joined: Tue Sep 21, 2010 4:33 pm

Re: Pie Charts with Min 0

Postby GWoodburn » Mon Feb 20, 2012 8:04 pm

I know what you mean. But isn't the spend the whole in this case? Wouldn't a credit be an entirely different set of data? So if there was 2k in spend throwing out the credit shouldn't affect that I am still showing 100%. Is that wrong?
GWoodburn
 
Posts: 13
Joined: Wed Feb 01, 2012 8:17 am

Re: Pie Charts with Min 0

Postby jlbriggs » Mon Feb 20, 2012 11:27 pm

Yes, I must have missed the details of the spend vs credit in your previous post. :)

(That said, there are a lot of arguments that can be made for why a bar chart is still a better option :D )
fiddles: http://jsfiddle.net/jlbriggs/J9JLr/
jlbriggs
 
Posts: 1458
Joined: Tue Sep 21, 2010 4:33 pm

Re: Pie Charts with Min 0

Postby GWoodburn » Fri Feb 24, 2012 1:13 am

hahaha. That's why we give them the option of either or. When they first hit the page the default is always column. But they can select Pie as well. Giving the user the option to consume the data the way they see fit.
GWoodburn
 
Posts: 13
Joined: Wed Feb 01, 2012 8:17 am


Return to Highcharts Usage

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot], Webtransformer and 5 guests

cron