mark m in Seattle

Pie Charts - Sort order of slices

Recommended Posts

The sort order of the slices of pie seems to conform to the most common application of Pie Charts where one wants to see the biggest slice then the 2nd biggest, then the 3rd, in a ranking.

But sometimes there is a alternate meaningfull order.

Case in point.  I want to show a pie chart of sales per product category.  I want one pie for the corporation as a whole and one for each division.  I'm used to seeing product categories in a certain sequence on all my other reports, entry screens, etc. 

And when I want to visually compare corporate pie to division pies (and among divsion pies) it would really help if the product categories were always in the same order (and always the same color) regardless of the size of the slice.  Does that make sense?

Share this post


Link to post
Share on other sites

Im making several pie charts from a database and I would like to set the color of each slice based off the color supplied within the database.

The colors are stored in hex since I used them for coloring my tables and text on the page. I have a function that converts them to an rgb array.

The number of categories in my pie chart are dynamic, depending on what activity has taken place in the set time period.

I pull everything together in different arrays.

Heres some sample code I have been playing with, so far I have managed only to ensure that all the categories are black.

Code:

Share this post


Link to post
Share on other sites

Hi Erick,

FusionCharts provides the option to configure the plot colors in two possible ways :

- paletteColors attribute : To set the plot colors globally. A comma separated list of colors applied in a round-robin way.

- color attribute : For individual plots.

Please refer to these links for further information:-

Color individual data plots: https://www.fusioncharts.com/dev/chart-guide/chart-configurations/data-plot#color-individual-data-plots

Color different Data Plots: https://www.fusioncharts.com/dev/chart-guide/chart-configurations/data-plot#color-different-data-plots

You can use either of the possible ways to configure the plot colors according to your requirement.

Please note : These attributes accepts hexadecimal color codes.

However, your code was not present in your post.

 

Hope this will help.

Thanks,

Srishti

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now