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 ...
Serious Bug in TAreaSeries OnClick event
Re: Serious Bug in TAreaSeries OnClick event
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:
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,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Serious Bug in TAreaSeries OnClick event
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.
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.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Serious Bug in TAreaSeries OnClick event
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.
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 |
Instructions - How to post in this forum |