XValueIndex and XValue

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
msd48
Newbie
Newbie
Posts: 14
Joined: Mon Oct 15, 2007 12:00 am

XValueIndex and XValue

Post by msd48 » Fri Aug 29, 2008 6:13 am

Hi!

I have some series

Code: Select all

...
series1.HorizAxis := aBottomAxis;
series1.XValues.DateTime := true;
...
how i can get XValueIndex by XValue?
I need some function like this

Code: Select all

var
  dt: TDateTime;
  vValueIndex: integer;
begin
 ...
  dt := StrToDateTime('21.11.2008 11:00');
  vValueIndex := someFunction(dt);
 ...
end;


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

Post by Narcís » Fri Aug 29, 2008 8:05 am

Hi msd48,

You can use Locate method:

Code: Select all

  vValueIndex := Series1.XValues.Locate(dt);
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

msd48
Newbie
Newbie
Posts: 14
Joined: Mon Oct 15, 2007 12:00 am

Post by msd48 » Fri Aug 29, 2008 8:17 am

Hi, Narcís

It`s magnificent!
Thanks for the early reply!

Question is closed.

Post Reply