SOLVED Urgent: Identify a Point in a pointseries after...

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
ChZiegelt
Newbie
Newbie
Posts: 39
Joined: Thu Aug 09, 2007 12:00 am
Contact:

SOLVED Urgent: Identify a Point in a pointseries after...

Post by ChZiegelt » Tue Nov 25, 2008 12:55 pm

Scenario:

I have a 2D pointseries with x/y coordinates.
Each point has an index on which I identify him. Like

Code: Select all

series.XValues[ Index ]
.

The problem now is, I can move this points on the chart by dragging them.
Eachtime I move the point I changed the coords like this way:

Code: Select all

series.XValues[ OldIndex ] := newX;

And the same for the yvalue.

After changing this TChart sorts the points in a manner that the indexes are changing. OldIndex isn't Oldindex anymore after changing x or Y Values.

How do I get the new Index for my old point ?

Any Help welcome !
Thanks in advance.
Last edited by ChZiegelt on Tue Nov 25, 2008 1:16 pm, edited 1 time in total.

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

Post by Narcís » Tue Nov 25, 2008 1:12 pm

Hi ChZiegelt,

I can think of 2 options here:

1. Set series not to be ordered before populating them so that indexes don't change:

Code: Select all

  Series1.XValues.Order:=loNone;
  Series1.YValues.Order:=loNone;
  Series1.FillSampleValues();
2. Use Locate method for finding new indexes:

Code: Select all

  NewIndex:=Series1.XValues.Locate(NewXValue);
Hope this helps!
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

ChZiegelt
Newbie
Newbie
Posts: 39
Joined: Thu Aug 09, 2007 12:00 am
Contact:

Post by ChZiegelt » Tue Nov 25, 2008 1:14 pm

I never told you, but you are like an angel :-)

Thank you very much !

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

Post by Narcís » Tue Nov 25, 2008 1:38 pm

Hi ChZiegelt,

Thank you very much. I'm glad to hear that helped :D .
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