Page 1 of 1

XValueIndex and XValue

Posted: Fri Aug 29, 2008 6:13 am
by 10547029
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;


Posted: Fri Aug 29, 2008 8:05 am
by narcis
Hi msd48,

You can use Locate method:

Code: Select all

  vValueIndex := Series1.XValues.Locate(dt);

Posted: Fri Aug 29, 2008 8:17 am
by 10547029
Hi, NarcĂ­s

It`s magnificent!
Thanks for the early reply!

Question is closed.