OnClickSeries is not triggered for 3D charts

TeeChart FireMonkey (Windows,OSX,iOS & Android) for Embarcadero RAD Studio, Delphi and C++ Builder (XE5+)
Yeray
Site Admin
Site Admin
Posts: 9504
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: OnClickSeries is not triggered for 3D charts

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
mstsc_yi0OQfZXaD.png (36.85 KiB) Viewed 14826 times
I'll give a try at the same in C++Builder.
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

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

Re: OnClickSeries is not triggered for 3D charts

Post by Yeray » Thu Jan 19, 2023 5:49 pm

Hello,

Find attached the same project translated to C++Builder.
OnClickSeriesFMXBCB.zip
(10.21 KiB) Downloaded 556 times
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.
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

PCSdeZ
Newbie
Newbie
Posts: 18
Joined: Thu Dec 16, 2021 12:00 am

Re: OnClickSeries is not triggered for 3D charts

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 502 times

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

Re: OnClickSeries is not triggered for 3D charts

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
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

PCSdeZ
Newbie
Newbie
Posts: 18
Joined: Thu Dec 16, 2021 12:00 am

Re: OnClickSeries is not triggered for 3D charts

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
Site Admin
Posts: 9504
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: OnClickSeries is not triggered for 3D charts

Post by Yeray » Mon Jan 23, 2023 5:50 pm

Hello,

I've just fixed #2584 for the next maintenance release.
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

PCSdeZ
Newbie
Newbie
Posts: 18
Joined: Thu Dec 16, 2021 12:00 am

Re: OnClickSeries is not triggered for 3D charts

Post by PCSdeZ » Mon Jan 23, 2023 10:10 pm

Excellent, thanks Yeray!

Post Reply