Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

pie charts

 
phani kon
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The labels are just strings - you can pass in whatever you can stuff into a string.
 
phani kon
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your help. what do I have to write in my jsp page for the?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using cewolf? If so, the easiest way would probably be to write a ChartPostProcessor.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic