One More FMX vs VCL Chart Help

TeeChart FireMonkey (Windows,OSX,iOS & Android) for Embarcadero RAD Studio, Delphi and C++ Builder (XE5+)
Post Reply
PastorMic
Newbie
Newbie
Posts: 16
Joined: Mon Aug 28, 2017 12:00 am

One More FMX vs VCL Chart Help

Post by PastorMic » Thu Aug 31, 2017 7:30 pm

Hi,

I am stuck on the labels with the pie and also on the legend. Below are two screen grabs - one from the VCL version which shows it as I need to show it. The other is from the FMX version that is incorrect. I can't see any difference in the properties between the two versions. FMX just does things differently and I am not able to figure this out.

In the VCL version, you'll note that the legend shows a range of dollars donated, which is correct. It also shows another number in the legend, which represents the total dollars given from that range.

In the FMX version, I cannot seem to find how to get the pie chart's labels to show as $ (dollars), and the amounts on the legend also don't show as dollars. I've searched the help files but don't see how to set the marks for currency. Any help appreciated.

John
Attachments
Chart2FMX.JPG
This is the FMX version. I can't figure out how to make the $ sign show up on the pie's labels, and also on the total amounts shown in the legend.
Chart2FMX.JPG (49.2 KiB) Viewed 11470 times
Chart2VCL.JPG
This is the VCL version. Both the legend and the pie chart's labels are correct.
Chart2VCL.JPG (51.39 KiB) Viewed 11465 times

PastorMic
Newbie
Newbie
Posts: 16
Joined: Mon Aug 28, 2017 12:00 am

Re: One More FMX vs VCL Chart Help

Post by PastorMic » Thu Aug 31, 2017 7:34 pm

Oops - sorry, I uploaded the wrong file. Here's the correct FMX file that shows the labels without the dollar signs that I referenced above.

John
Attachments
Chart2FMX.JPG
This is the correct FMX example.
Chart2FMX.JPG (48.41 KiB) Viewed 11459 times

Yeray
Site Admin
Site Admin
Posts: 9509
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: One More FMX vs VCL Chart Help

Post by Yeray » Fri Sep 01, 2017 7:48 am

Hello,

TeeChart converts the values to strings using the series ValueFormat, which is by default '#,##0.###'. You can add the '$' before it and it will do what you want. Ie:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Series1.AddPie(561, '$1.00 to $25.00');
  Series1.AddPie(909.5, '$26.00 to $50.00');
  Series1.AddPie(365, '$51.00 to $100.00');
  Series1.AddPie(3545, '$101.00 to $1,000.00');
  Series1.AddPie(2500, '$1,001.00 to $10,000.00');

  Series1.Marks.Style:=smsValue;
  Series1.ValueFormat:='$'+Series1.ValueFormat;
end;
Project1_2017-09-01_09-48-10.png
Project1_2017-09-01_09-48-10.png (27.41 KiB) Viewed 11456 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply