ZValue on TContourSeries

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Werner
Newbie
Newbie
Posts: 46
Joined: Mon Aug 06, 2007 12:00 am

ZValue on TContourSeries

Post by Werner » Thu Dec 06, 2007 4:28 pm

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

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 Dec 07, 2007 10:01 am

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;
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

Werner
Newbie
Newbie
Posts: 46
Joined: Mon Aug 06, 2007 12:00 am

Post by Werner » Fri Dec 07, 2007 10:56 am

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

Pep
Site Admin
Site Admin
Posts: 3299
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Dec 10, 2007 4:53 pm

Hi Werner,

are you creatinga 2D or 3D Contour Chart ?

Werner
Newbie
Newbie
Posts: 46
Joined: Mon Aug 06, 2007 12:00 am

ZValue on TContourSeries

Post by Werner » Mon Dec 10, 2007 5:10 pm

Hi Pep,

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

best regards
Werner

Post Reply