Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Optional grouping breaking pie chart
nelsont
I have a pie chart in my report that contains a legend that must be displayed in a certain way. This is a requirement from the customer.
It is not alphabetical and there is no natural sort order, so in my database I created a numeric "rank" field and gave each entry a number. There are 5 entries.
If I just use the data field as my category grouping, the pie chart looks correct, but BIRT wants to display the legend in alphabetical order. But when I try to use my rank field as the optional group, the pie chart splits up, basically making a small pie chart for each entry in the legend. In other words it breaks out into 5 small circles, each a solid color (each pie chart contains 100% of one entry).
When I was using a bar chart I did not have this issue - I did it exactly the way I describe above. But another requirement from the customer is to change from the bar chart to the pie chart.
I have also tried combining my data and rank fields together, and just displaying the data portion by using this as my optional grouping (this is what I was using in the bar chart):
row["RANK_FIELD"].substr(2,1)+row["DATA_FIELD"]
but I get the same problem.
Any ideas? I'm running BIRT 11.0.3, Service Pack 2.
Find more posts tagged with
Comments
mwilliams
When you're selecting your data, for you chart, try clicking the grouping and sorting button, next to the category field and sorting by your ranking field. The legend should sort by this as well.
nelsont
Hey, thanks for the response.
Your suggestion makes the legend display in the correct order, but the pie chart is still broken out into small circles, one for each entry in the legend.
I just figured out how to fix it!
I didn't use the 'optional grouping' at all. I ended up just putting my data field in the category slot, then using the grouping and sorting button next to that. I picked the rank field and it is working.
I assumed I had to use the optional grouping to do what I needed. Your post gave me the idea to try the grouping and sorting next to the category field.
Thanks, I really appreciate it.
mwilliams
Sorry, I should have specified to remove the optional grouping. That's what I get for assuming that you knew that was implied.