TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
-
moelski
- Advanced
- Posts: 212
- Joined: Mon Apr 23, 2007 12:00 am
- Location: Germany
-
Contact:
Post
by moelski » Wed Feb 06, 2008 10:03 pm
Hi !
I think it is an easy task, but I can´t find a way - maybe it´s to late
I use the TColorBandTool for marking an area. I got to values back:
Tool.StartValue
Tool.EndValue
These are x values. But how du I get the resulting index of the data table? I need a call like this:
I know that this wont work because XValue needs an index / integer value. How can I get the index for a given value?
Maybe I´m blinded ...
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Thu Feb 07, 2008 9:29 am
Hi Dominik,
Yes, maybe some sleeping would help
.
You can use Locate method as in the code snippet I posted
here.
-
moelski
- Advanced
- Posts: 212
- Joined: Mon Apr 23, 2007 12:00 am
- Location: Germany
-
Contact:
Post
by moelski » Thu Feb 07, 2008 9:43 am
hi Narcis,
Ok that works ...
Chart[0].XValues.Locate(Tool.StartValue)
but one little problem left:
If you change the left position of the TColorBandTool then Tool.StartValue can contain values like 20,31252134 which is not a valid X value. The result is -1 ...
Is it possible to have a snapping for the TColorBandTool or the possibility that Locate uses the nearest value within the XValues?