OnClickSeries with TLineSeries selects the wrong point
OnClickSeries with TLineSeries selects the wrong point
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
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
Re: OnClickSeries with TLineSeries selects the wrong point
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.
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,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 11
- Joined: Wed Jul 07, 2010 12:00 am
Re: OnClickSeries with TLineSeries selects the wrong point
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
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 535 times
Re: OnClickSeries with TLineSeries selects the wrong point
Hi Kevin,
Changing the line in your code:
for this:
It works fine except for the first segment, that always shows 'BACKGROUND', isn't it?
Changing the line in your code:
Code: Select all
clickedIndex := Series.Clicked(X, Y);
Code: Select all
clickedIndex := (Series.Clicked(X, Y) + 1);
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: OnClickSeries with TLineSeries selects the wrong point
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
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
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: OnClickSeries with TLineSeries selects the wrong point
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.
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 |
Instructions - How to post in this forum |
Re: OnClickSeries with TLineSeries selects the wrong point
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
Please confirm I will be able to realize the correction in the 2009 environment.
thxs,
dmo
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: OnClickSeries with TLineSeries selects the wrong point
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.
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 |
Instructions - How to post in this forum |
Re: OnClickSeries with TLineSeries selects the wrong point
Hi dmo,
The clicked problem (TV52015018) has been already fixed and it will be available in the next maintenance release.
The clicked problem (TV52015018) has been already fixed and it will be available in the next maintenance release.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: OnClickSeries with TLineSeries selects the wrong point
Awesome!
Do you have any idea when the next maintenance release will be?
thxs,
dmo
Do you have any idea when the next maintenance release will be?
thxs,
dmo
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: OnClickSeries with TLineSeries selects the wrong point
Hi dmo,
It should be imminent. We are working on some installers issues right now.
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 |
Instructions - How to post in this forum |
Re: OnClickSeries with TLineSeries selects the wrong point
Was wondering if you had an update on the next release date
-dmo
-dmo
Re: OnClickSeries with TLineSeries selects the wrong point
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.
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,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: OnClickSeries with TLineSeries selects the wrong point
Ah yes - the European summer vacations.
I'm jealous.
I'm jealous.
Re: OnClickSeries with TLineSeries selects the wrong point
New release date?
thxs,
dmo
thxs,
dmo