TeeChart FireMonkey (Windows,OSX,iOS & Android) for Embarcadero RAD Studio, Delphi and C++ Builder (XE5+)
-
Yeray
- Site Admin
- Posts: 9622
- Joined: Tue Dec 05, 2006 12:00 am
- Location: Girona, Catalonia
-
Contact:
Post
by Yeray » Thu Jan 19, 2023 2:52 pm
Hello,
With following delphi code, I'm importing your tee file and adding an
OnClickSeries
event to the created
TDBChart
.
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var DBChart1: TDBChart;
begin
Caption:=TeeMsg_Version;
DBChart1:=TDBChart.Create(Self);
LoadChartFromFile(DBChart1, 'F:\Downloads\teeFile.tee');
DBChart1.Parent:=Self;
DBChart1.OnClickSeries:=ChartOnClickSeries;
end;
procedure TForm1.ChartOnClickSeries(Sender:TCustomChart; Series:TChartSeries; ValueIndex:Integer;
Button:TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ShowMessage('OnClickSeries event fired!')
end;
initialization
RegisterTeeStandardSeries;
And it seems to work fine for me here:
- mstsc_yi0OQfZXaD.png (36.85 KiB) Viewed 36037 times
I'll give a try at the same in C++Builder.
-
Yeray
- Site Admin
- Posts: 9622
- Joined: Tue Dec 05, 2006 12:00 am
- Location: Girona, Catalonia
-
Contact:
Post
by Yeray » Thu Jan 19, 2023 5:49 pm
Hello,
Find attached the same project translated to C++Builder.
I can't reproduce the problem with it, so I can't say what's wrong in your project yet.
However, you could try if it works for you so we can see if we are missing anything else.
-
PCSdeZ
- Newbie
- Posts: 18
- Joined: Thu Dec 16, 2021 12:00 am
Post
by PCSdeZ » Fri Jan 20, 2023 2:32 am
Hello,
Thank you for your patience.
The project you sent me is loading the 2D chart which is what I'm using in my app, but the 3D chart is where it fails.
I'm really sorry because I sent you the teeFile.tee generated by the 2D version and of course it works. Now I'm sending you the teeFile.tee for the 3D graph. I tried the C++Builder project you kindly sent me and it fails here.
Best regards,
Patricio Cerda
-
Attachments
-
- teeFile.rar
- (1.06 KiB) Downloaded 2018 times
-
Yeray
- Site Admin
- Posts: 9622
- Joined: Tue Dec 05, 2006 12:00 am
- Location: Girona, Catalonia
-
Contact:
Post
by Yeray » Fri Jan 20, 2023 10:19 am
Hello,
I can reproduce the problem and simplifying it to the minimum, you just need two
TBarSeries
. The
TAreaSeries
doesn't look necessary:
Code: Select all
var Chart1: TChart;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1:=TChart.Create(Self);
with Chart1 do
begin
Parent:=Self;
Align:=alClient;
AddSeries(TBarSeries).FillSampleValues(2);
AddSeries(TBarSeries).FillSampleValues(2);
OnClickSeries:=Chart1ClickSeries;
end;
end;
procedure TForm1.Chart1ClickSeries(Sender: TCustomChart; Series: TChartSeries;
ValueIndex: Integer; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ShowMessage('OnClickSeries event fired!');
end;
I've added it to the public tracker:
#2584
-
PCSdeZ
- Newbie
- Posts: 18
- Joined: Thu Dec 16, 2021 12:00 am
Post
by PCSdeZ » Fri Jan 20, 2023 12:47 pm
Hello,
Just for the context: the other TBarSeries are there because at runtime, on my application, the user can select other datasets ('USD' and/or 'CLP' money exchange, and 'Realizados' o 'Pendientes' items). And the TAreaSeries are also activated or not by the user to show the composed amount between all items on the chart.
So, I activate or deactivate the series depending on the user selection.
Best regards,
Patricio Cerda
-
Yeray
- Site Admin
- Posts: 9622
- Joined: Tue Dec 05, 2006 12:00 am
- Location: Girona, Catalonia
-
Contact:
Post
by Yeray » Mon Jan 23, 2023 5:50 pm
Hello,
I've just fixed
#2584 for the next maintenance release.
-
PCSdeZ
- Newbie
- Posts: 18
- Joined: Thu Dec 16, 2021 12:00 am
Post
by PCSdeZ » Mon Jan 23, 2023 10:10 pm
Excellent, thanks Yeray!