Topic: Pie Chart that displays percentage along with legend?

Hello MVD community, I haven't played around much with the charts but is there a way to display a pie chart that shows percentage
along with the values and names on the graphics?  I know that the legend gets created automatically but there's no much information
other than the colors and the names of the values.  Is there a way to control that?


Thanks in advance!

Attached is an example of what I mean, what I would like to see:

https://ibb.co/bEX3no

Re: Pie Chart that displays percentage along with legend?

Hi Alex,
Does the attached give you the sort of thing you're after (values and percentages with the legend)?
Regards,
Derek.

Post's attachments

Attachment icon derek piechart.zip 340.14 kb, 484 downloads since 2018-06-08 

Re: Pie Chart that displays percentage along with legend?

derek wrote:

Hi Alex,
Does the attached give you the sort of thing you're after (values and percentages with the legend)?
Regards,
Derek.

Yes!  as always that's awesome Derek.  Thanks for your help.  One more thing, is there anyway to get rid
of the shadows?  Or is that something that's internal of the Pie Chart function?

4 (edited by derek 2018-06-10 09:25:18)

Re: Pie Chart that displays percentage along with legend?

Hello Alex,
In the script, just add the line
  Chart.View3D:=false;   
You could actually remove the legend as well, as it is now simply repeating the information that displays against each slice of the piechart.  You can do that with the line. 
  Chart.legend.visible:=false;
Obviously, in some examples and with lots of 'slices' it starts to get a bit impractical, but it's something to bear in mind.
Both these options are in the attachment.
Derek.

Post's attachments

Attachment icon derek piechart 2.zip 340.33 kb, 465 downloads since 2018-06-10 

Re: Pie Chart that displays percentage along with legend?

derek wrote:

Hello Alex,
In the script, just add the line
  Chart.View3D:=false;   
You could actually remove the legend as well, as it is now simply repeating the information that displays against each slice of the piechart.  You can do that with the line. 
  Chart.legend.visible:=false;
Obviously, in some examples and with lots of 'slices' it starts to get a bit impractical, but it's something to bear in mind.
Both these options are in the attachment.
Derek.


Awesome!  - Thanks again mate  smile

Cheers!

Re: Pie Chart that displays percentage along with legend?

derek wrote:

Hello Alex,
In the script, just add the line
  Chart.View3D:=false;   
You could actually remove the legend as well, as it is now simply repeating the information that displays against each slice of the piechart.  You can do that with the line. 
  Chart.legend.visible:=false;
Obviously, in some examples and with lots of 'slices' it starts to get a bit impractical, but it's something to bear in mind.
Both these options are in the attachment.
Derek.

Ahhh almost forgot, Derek - one more thing, are you able to print , say if you create a button for a report, the chart?  Along with the data that you gather, also print the chart in the report page. Is that something you have done?

Re: Pie Chart that displays percentage along with legend?

Hi Alex,
I'm afraid I'll have to pass on how to print the chart together with the data;  reporting is one of the areas that I'm pretty weak on (there doesn't seem to be much call for print-outs with the stuff that I'm asked to write). 
Feeble excuse, I know (LOL!) and I should take the opportunity to get up to speed but I think it would take me quite a while.
Maybe someone else who's worked more with charts/reports will have a few ideas.
Derek.

Re: Pie Chart that displays percentage along with legend?

derek wrote:

Hi Alex,
I'm afraid I'll have to pass on how to print the chart together with the data;  reporting is one of the areas that I'm pretty weak on (there doesn't seem to be much call for print-outs with the stuff that I'm asked to write). 
Feeble excuse, I know (LOL!) and I should take the opportunity to get up to speed but I think it would take me quite a while.
Maybe someone else who's worked more with charts/reports will have a few ideas.
Derek.

Okie, no problem Derek I appreciate all your help.  Maybe Dimitri can help on this one smile

Re: Pie Chart that displays percentage along with legend?

derek
You can enable percentages for the legend:

..
Chart.AddSeries(TpieSeries.Create(Chart)); 
TPieSeries(Chart.Series[0]).Marks.Style := smsLabelPercent;
..
Dmitry.

Re: Pie Chart that displays percentage along with legend?

gonpublic2k wrote:

Okie, no problem Derek I appreciate all your help.  Maybe Dimitri can help on this one smile

An example, how to print chart using report system

Post's attachments

Attachment icon derek piechart_fixed.zip 9.27 kb, 551 downloads since 2018-06-12 

Dmitry.

Re: Pie Chart that displays percentage along with legend?

DriveSoft wrote:

derek
You can enable percentages for the legend:

..
Chart.AddSeries(TpieSeries.Create(Chart)); 
TPieSeries(Chart.Series[0]).Marks.Style := smsLabelPercent;
..

Good to know, thanks both Derek and Dimitri!

Re: Pie Chart that displays percentage along with legend?

DriveSoft wrote:
gonpublic2k wrote:

Okie, no problem Derek I appreciate all your help.  Maybe Dimitri can help on this one smile

An example, how to print chart using report system


Great!!!  Thanks so much!