Page 1 of 1

ZValue on TContourSeries

Posted: Thu Dec 06, 2007 4:28 pm
by 10546313
Hi,
I use Teechart V8.02. AT my Tchart I have added a TContourSeries and a TCursorTool assigned to that series.
With the event
ChartTool1Change(Sender: TCursorTool; x, y: Integer;
const XValue, YValue: Double; Series: TChartSeries; ValueIndex: Integer);

I want to show x,y and z value. XValue and YValue are provided with this event, but how can I get the Z-Value ?
ValueIndex is alwas -1.
The function (Series as TContourSeries).GetCursorValueIndex returns only the LevelIndex.
Locate returns also -1.

What can I do ?
Best regards
Werner

Posted: Fri Dec 07, 2007 10:01 am
by narcis
Hi Werner,
ValueIndex is alwas -1.


This is a bug (TV52012626) which I've added to our defect list to be fixed for future releases.

In the meantime you can use OnMouseMove event like this:

Code: Select all

procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
var index: Integer;
begin
  index:=Series1.Clicked(X,Y);

  if index<>-1 then
  begin
    Caption:=FloatToStr(Series1.XValues[index]) + ', ' +
              FloatToStr(Series1.YValues[index]) + ', ' +
              FloatToStr(Series1.ZValues[index]);
  end;
end;

Posted: Fri Dec 07, 2007 10:56 am
by 10546313
Dear Narzis,

thank you for your help, but this doesn't work. The index is always the level and not the index of the array.
Any other suggestion ?

with best regards
Werner

Posted: Mon Dec 10, 2007 4:53 pm
by Pep
Hi Werner,

are you creatinga 2D or 3D Contour Chart ?

ZValue on TContourSeries

Posted: Mon Dec 10, 2007 5:10 pm
by 10546313
Hi Pep,

I use the TContourSeries wich 3D unchecked, so the view is 2D.

best regards
Werner