OnClickSeries with TLineSeries selects the wrong point

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
dmo9999
Newbie
Newbie
Posts: 8
Joined: Mon May 05, 2008 12:00 am

OnClickSeries with TLineSeries selects the wrong point

Post by dmo9999 » Wed Jul 07, 2010 4:26 pm

I am having a problem now with the TChart.OnClickSeries event handler. In my handler, I access the 'selected' point using the ValueIndex parameter, but sometimes it isn't the correct point. The X axis value appears to be correct, but the Y value can be off by a very large value.

I also tried using TChartSeries.GetCursorValueIndex instead of ValueIndex, but it did not correct the problem.

The 'y' value returned from TChartSeries.GetCursorValues(x,y) was correct.

I have three TLineSeries added to the chart. Two of them do not have any points.

Is it possible the OnClickSeries event is only considering the X axis? If yes, how do I enable the consideration of the Y axis?

Any other words of wisdom?

thxs,
dmo

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

Re: OnClickSeries with TLineSeries selects the wrong point

Post by Yeray » Thu Jul 08, 2010 3:56 pm

Hi dmo,

I've seen that both the clicked method and the ClickSeries event return the index one position to the left to the correct point clicked.
I've reproduced it in v2010 so I've added it to the defect list to be fixed asap (TV52015018).
For example, if you click in the segment between pointindex 2 and 3, you get ValueIndex 1 while you should get 2.

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1.View3D:=false;

  for i:=0 to Chart1.SeriesCount-1 do
    Chart1[i].FillSampleValues(5);
end;

procedure TForm1.Chart1ClickSeries(Sender: TCustomChart;
  Series: TChartSeries; ValueIndex: Integer; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var clickedIndex: Integer;
begin
  Chart1.Title.Text.Text:='ValueIndex: ' + IntToStr(ValueIndex) + ', X: ' + FloatToStr(Series.XValue[ValueIndex]) + ', Y: ' + FloatToStr(Series.YValue[ValueIndex]);

  clickedIndex:=Series.Clicked(X,Y);
  if clickedIndex <> -1 then
    Chart1.Title.Text.Text:=Chart1.Title.Text.Text + 'ValueIndex: ' + IntToStr(clickedIndex) + ', X: ' + FloatToStr(Series.XValue[clickedIndex]) + ', Y: ' + FloatToStr(Series.YValue[clickedIndex]);
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

KevinKillion
Newbie
Newbie
Posts: 11
Joined: Wed Jul 07, 2010 12:00 am

Re: OnClickSeries with TLineSeries selects the wrong point

Post by KevinKillion » Sun Jul 11, 2010 7:08 pm

Hi!

Sorry to say, but the problem is certainly more than just an index off by one.

To test, I created a chart with several series. As in your example, I set the title according to onSeriesClick, but I also show the series.Name. In addition, I set the title when onClickBackground fires, to more easily see when onClickSeries fails to fire.

***Many*** clicks at or very near a point(ANY point) fail to fire the onClickSeries event. KEEP CLICKING, eventually onClickSeries fires, but it may return the wrong series or the wrong point.

ATTACHED is a Delphi 2010 project that illustrates the problem. I've included the built Project1.exe so you can try it without recompiling, if you wish.

I am using TeeChartPro v2010.00.00407, within Delphi 2010 version 14.0.3593.25826.

THANK YOU!!!!!!!

Kevin Killion
Attachments
TeeChart returns wrong series click.rar
(509.2 KiB) Downloaded 534 times

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

Re: OnClickSeries with TLineSeries selects the wrong point

Post by Yeray » Tue Jul 13, 2010 8:13 am

Hi Kevin,

Changing the line in your code:

Code: Select all

clickedIndex := Series.Clicked(X, Y);
for this:

Code: Select all

clickedIndex := (Series.Clicked(X, Y) + 1);
It works fine except for the first segment, that always shows 'BACKGROUND', isn't it?
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

dmo9999
Newbie
Newbie
Posts: 8
Joined: Mon May 05, 2008 12:00 am

Re: OnClickSeries with TLineSeries selects the wrong point

Post by dmo9999 » Tue Jul 13, 2010 4:21 pm

Thank-you for the feedback.

I would like to use the corrected method when it becomes available.

How do I
1) learn when it's fixed?
2) get the corrected s/w?

We are currently using Delphi 2009 with TChart 8.04 (soon to be 8.07).

thanks again!
-dmo

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

Re: OnClickSeries with TLineSeries selects the wrong point

Post by Narcís » Wed Jul 14, 2010 9:48 am

Hi dmo,

I recommend you to stay tuned to this forum or subscribe to our RSS news feed for new release announcements and what's fixed on them.
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

dmo9999
Newbie
Newbie
Posts: 8
Joined: Mon May 05, 2008 12:00 am

Re: OnClickSeries with TLineSeries selects the wrong point

Post by dmo9999 » Wed Jul 14, 2010 12:56 pm

Thank-you. I will continue to monitor this post.

Please confirm I will be able to realize the correction in the 2009 environment.

thxs,
dmo

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

Re: OnClickSeries with TLineSeries selects the wrong point

Post by Narcís » Wed Jul 14, 2010 1:16 pm

Hi dmo,

Yes, I think this will be fixed for RAD Studio 2009 too when it's fixed. I'm sorry but, even we do it occasionally, we can not commit to notifying all bug fixes at the threads where they have been reported. Please be aware at new release announcements at the TeeChart VCL forum or subscribe to the RSS feed.

Thanks in advance.
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

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

Re: OnClickSeries with TLineSeries selects the wrong point

Post by Yeray » Mon Jul 19, 2010 11:35 am

Hi dmo,

The clicked problem (TV52015018) has been already fixed and it will be available in 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

dmo9999
Newbie
Newbie
Posts: 8
Joined: Mon May 05, 2008 12:00 am

Re: OnClickSeries with TLineSeries selects the wrong point

Post by dmo9999 » Wed Jul 21, 2010 2:14 pm

Awesome!
Do you have any idea when the next maintenance release will be?

thxs,
dmo

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

Re: OnClickSeries with TLineSeries selects the wrong point

Post by Narcís » Wed Jul 21, 2010 2:18 pm

Hi dmo,

It should be imminent. We are working on some installers issues right now.
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

dmo9999
Newbie
Newbie
Posts: 8
Joined: Mon May 05, 2008 12:00 am

Re: OnClickSeries with TLineSeries selects the wrong point

Post by dmo9999 » Mon Aug 09, 2010 6:39 pm

Was wondering if you had an update on the next release date
-dmo

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

Re: OnClickSeries with TLineSeries selects the wrong point

Post by Yeray » Tue Aug 10, 2010 8:35 am

Hi dmo,

We found some problems when testing the installers we couldn't repair before vacation time. So I'm afraid the maintenance release will be delayed some weeks. :(
Excuse us for the inconvenience.
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

dmo9999
Newbie
Newbie
Posts: 8
Joined: Mon May 05, 2008 12:00 am

Re: OnClickSeries with TLineSeries selects the wrong point

Post by dmo9999 » Tue Aug 10, 2010 2:37 pm

Ah yes - the European summer vacations.
I'm jealous.

dmo9999
Newbie
Newbie
Posts: 8
Joined: Mon May 05, 2008 12:00 am

Re: OnClickSeries with TLineSeries selects the wrong point

Post by dmo9999 » Tue Sep 21, 2010 5:15 pm

New release date?
thxs,
dmo

Post Reply