aspose file tools*
The moose likes Other Open Source Projects and the fly likes pie charts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "pie charts" Watch "pie charts" New topic
Author

pie charts

phani kon
Ranch Hand

Joined: Apr 06, 2005
Posts: 251
Hi,

Can anyone help me in this case?

I am working on pie charts using cewolf. I would like to know, Is there any way I can show the percentages on the lables of the pie chart.Please let me know, do you have any examples?


thanks a lot
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
The labels are just strings - you can pass in whatever you can stuff into a string.


Ping & DNS - updated with new look and Ping home screen widget
phani kon
Ranch Hand

Joined: Apr 06, 2005
Posts: 251
Could you please give me some examples for showing percentage on the lables like 73.45%.

Actually I am doing this code in the method DefaultPieDataset

dataset.setValue(sCategory[iCategory],s1);
//Here I am getting the values for s1 as 73.45 on the legend lables. I want show the legend lables as 73.45%
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
Those labels are taken from the category - the first parameter of that method (which is a string, so it can contain any character you need).
phani kon
Ranch Hand

Joined: Apr 06, 2005
Posts: 251
By using the below code

dataset.setValue(sCategory[iCategory],s1);

I am getting the lables as ALL = 56.78 KIO = 67.89 so on

My question is, How would I change to ALL = 56.78% KIO = 67.89% and so on
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
If you want the change just the labels -and not the categories-, then the easiest would be to use a custom label generator, something like this:

phani kon
Ranch Hand

Joined: Apr 06, 2005
Posts: 251
Thanks for your help. what do I have to write in my jsp page for the?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
Are you using cewolf? If so, the easiest way would probably be to write a ChartPostProcessor.
 
 
subject: pie charts
 
Similar Threads
generating line/pie/bar/column charts
labels in the pie section of piechart
cewolf charts
Generating line/pie/column /bar charts
Generate pie charts throug jsp