Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Pie chart min slice
vash
I'm working on a pie chart and I would like to display the top N categories, combining all others into another single category.
The data source is a flat file.
Any help would be appreciated.
-Vash
Find more posts tagged with
Comments
mwilliams
Hi Vash,
You could sort your dataSet by the field you want the top N of, create a computed column that does a count, then in the expression for the min slice, use this field to decide what goes in.
Hope this helps.
vash
Michael,
I have attached my rptdeisgn and TSV.
I have 2 charts in there - one pie chart and bar chart.
Can you please tell me - how to display TOP N in both those charts.
Thanks,
Vash.
mwilliams
Vash,
What version of BIRT are you using?
vash
Birt 2.3.2
mwilliams
Vash,
I was mistaken on how I remember the min slice thing working. I'll have to do some testing to see if I can make the charts look like you're wanting dynamically with a parameter for setting the 'N' in top N. I'll let you know if I come up with something.
vash
Ok, Thanks for looking into it.
vash
Michael,
Did you find something on how you can just display the Top 'N' values in both the pie chart and bar chart.
Thanks,
Vash
mwilliams
Vash,
Sorry for the delay. What you'll probably have to do is to bring the dataSet into a table first, determine the top N / others in the table, then use the table as the source for the chart.
vash
Michael,
Thank you so much for your reply.
It works perfectly.
Vash
mwilliams
Great! Glad to help!
vash
Now, I have other problem.
I am using Birt Professional and Birt Interactive Viewer.
I have a flat file datasource and I am creating a bar chart.
I want to display TOP N bars so i am using your approach to create a table and use it as data source for the chart.
I have attached my report design and flat file.
The first two charts (regular and flash) both use table data.
The problem is - I am not able to filter the table or the chart in Birt Interactive viewer.
The last two charts (regular and flash) use the data set. In the last two charts the grouping of emails is done inside the chart - so I dont know how to filter the chart in Interactive Viewer i.e. to get Top N email addresses.
Can you please help.
Vash.
mwilliams
Vash,
It looks like the numerical column in the table has filter in the menu. This may help with that way. As for the other way, I don't know that there's a good way to filter in the case of Top N without knowing the chart value series values. This would be something that could be requested as an enhancement to the IV, to be able to filter a chart based on the series values rather than just the dataSet values.
mwilliams
Vash,
It seems that for some reason the top N filter doesn't work but the "equal to" and "any of" and probably the others do. Not sure what the issue is there. I'll keep testing and let you know if I figure anything out.
mwilliams
Vash,<br />
<br />
Alright...It looks like if you delete the column binding and just put the aggregation in the table, you can select any one of the values in the table and there will be a filter icon, as seen in the attached image. If you click on this icon, you can set a Top N filter that works and changes the charts as expected. This is just a workaround. You should be able to select the entire column and filter that way as well, so it looks like there's a bug. You can file a bug report at <a class='bbc_url' href='
http://www.birt-exchange.org/bug-reporting/'>Business
Intelligence Software - Reporting Tools - BIRT Exchange</a><br />
<br />
Hope this helps.