Jump to content
We've recently updated our Privacy Statement, available here ×

How to add percentage value inside slice of pie chart and on the top of bars in bar chart?


daad.madhusudan

Recommended Posts

I am new to jasper repoting and I am creating some sample reports. Here I am sharing the reports that I created using ireport designer.

barchart.PNG.b12c415835aa504eb0bb6b97e7368a02.PNG               chart(1).PNG.eb664e8cc3490afb40f81d4e4f0c8876.PNG

I want the percentage values on the top of individual bar in the bar chart and inside individual slice in pie chart.  I couldn't achieve this using ireport designer. I read about using customizers but I couldn't get proper material. Can someone please help me to achieve this? 

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

For the pie-chart I added this property via the Show Advanceed Properties button. Note I had a variable which contained the total count which I used to calculat the percentage:

plotOptions.pie.dataLabels.formatter
Tick Use an expression
"function() { return ((this.y / " + $V{V_TOTAL_COUNT}.doubleValue() + ") * 100).toFixed(2) + '%';}"

 

Link to comment
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

×
×
  • Create New...