Serious Bug in TAreaSeries OnClick event

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Andre
Newbie
Newbie
Posts: 3
Joined: Thu Jun 02, 2005 4:00 am

Serious Bug in TAreaSeries OnClick event

Post by Andre » Thu Nov 17, 2011 8:30 pm

I am using Delphi XE and a chart containing an AreaSeries. The OnClick event has a serious bug which was reported many years ago and was apparently fixed.

The OnClick event has an arguement, ValueIndex, to provide the index of the series value clicked. BUT, the value provided is wrong. My original application was developed in Delphi 7 and 2007. How did this bug reappear in Delphi XE ?

Any help/advice gratefully accepted ...

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

Re: Serious Bug in TAreaSeries OnClick event

Post by Yeray » Fri Nov 18, 2011 4:32 pm

Hello Andre,

Could you please describe the problem with some more detail? I'm trying to reproduce the problem here with the following example and it seems to work fine for me here:

Code: Select all

uses Series;

procedure TForm1.FormCreate(Sender: TObject);
begin
//  Chart1.View3D:=false;

  with Chart1.AddSeries(TAreaSeries) as TAreaSeries do
  begin
    FillSampleValues();
    OnClick:=Series1Click;
  end;
end;

procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  Chart1.Title.Text.Text:='ValueIndex under the mouse: ' + IntToStr(Chart1[0].Clicked(X,Y));  //Clicked function is actually called in series OnClick event
end;

procedure TForm1.Series1Click(Sender: TChartSeries; ValueIndex: Integer;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  Caption:='ValueIndex Clicked: ' + IntToStr(ValueIndex);
end;
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

Andre
Newbie
Newbie
Posts: 3
Joined: Thu Jun 02, 2005 4:00 am

Re: Serious Bug in TAreaSeries OnClick event

Post by Andre » Mon Nov 21, 2011 6:24 pm

Hi Yeray

Thanks for your reply. I implemented your code and it also reports the incorrect ValueIndex.

The resultant AreaSeries shows about 24 points on the X axis and the OnClick event usually indicates ValueIndex to be 24, sometimes 20.

I did find an old post reporting this problem but it was apparently fixed in Delphi 2010. Very odd that it is working at your end and not mine. I am using Delphi XE on Windows 7.

Thanks
Andre.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Serious Bug in TAreaSeries OnClick event

Post by Narcís » Tue Nov 22, 2011 10:33 am

Hi Andre,

This also works fine for me here using Delphi XE in Windows 7 and TeeChart Pro 2011.04.41118, which we published yesterday, with the attached project. Could you please check if this version solves the problem at your end?

Thanks in advance.
Attachments
AreaXE.zip
(82.37 KiB) Downloaded 509 times
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply