Page 1 of 1

Cursor tool in 3d

Posted: Fri May 10, 2013 10:16 am
by 16564986
Hi

I am having problems getting the cursor tool to work in 3d. I have a chartgrid showing some data, and on mouse down I want the cursor tool to highlight the point

ie

procedure TForm1.ChartGridMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
ChartTool1.Visible:=true;
ChartTool1.XValue:= PCAChartGrid.Series.XValue[PCAChartGrid.row-2];
Charttool1.YValue:=PCAChartGrid.Series.YValue[PCAChartGrid.row-2];
end;

procedure TForm1.ChartGridMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
ChartTool1.Visible:=False;
end;

I cant find how to set the z value? it appears to be set somewhere, but it is not related to the point selected

Richard

Re: Cursor tool in 3d

Posted: Fri May 10, 2013 1:10 pm
by yeray
Hi Richard,

I'm not sure about what series type are you using and how would you like the cursor to be drawn.
The following is a 2D chart, but it seems to work fine for me here:

Code: Select all

uses Series, TeeTools;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=false;
  Chart1.Legend.Visible:=false;

  Chart1.AddSeries(TPointSeries).FillSampleValues;

  with Chart1.Tools.Add(TCursorTool) as TCursorTool do
  begin
    Chart1.Draw;
    Visible:=false;
  end;

  ChartGrid1.Chart:=Chart1;
  ChartGrid1.Series:=Chart1[0];
end;

procedure TForm1.ChartGrid1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  with Chart1.Tools[0] as TCursorTool do
  begin
    Visible:=true;
    XValue:=ChartGrid1.Series.XValue[ChartGrid1.row-2];
    YValue:=ChartGrid1.Series.YValue[ChartGrid1.row-2];
  end;
end;

procedure TForm1.ChartGrid1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  Chart1.Tools[0].Visible:=False;
end;
Could you please modify the code above so we can get a simple example project we can run as-is to reproduce the problem here?

Re: Cursor tool in 3d

Posted: Fri May 10, 2013 4:03 pm
by 16564986
Sorry I should have said, it is on various types of series
TBubble3DSeries
TPoint3DSeries
and TVector3dSeries

You can see the effect on the snap style demo in the teechart 2012

If you try to move the cursor over say the top, back, right point (Light brown for me) - the cursor is not in line with the point because it is well forward of the data point on the depth axis. Toggling the use z button just moves it back slightly NOT to the where the point is in 3D

I hope that makes sense

Richard

Re: Cursor tool in 3d

Posted: Mon May 13, 2013 10:27 am
by yeray
Hi Richard,

Right, the TCursorTool isn't calculating the Z Position when linked to a 3D series, it uses StartZ.
I've implemented it for the next maintenance release (TV52016570).

Re: Cursor tool in 3d

Posted: Mon May 20, 2013 10:06 am
by 16564986
Thank - sorry I didn't get back sooner

Any idea when the maintenance release is likely? I know you can't be exact, but a rough idea would help

Thanks again

Richard

Re: Cursor tool in 3d

Posted: Mon May 20, 2013 10:15 am
by narcis
Hi Richard,

It's imminent. We expect to publish it before the end of the week. Stay tuned!

Re: Cursor tool in 3d

Posted: Tue May 21, 2013 8:50 am
by 16564986
Great - I will keep lurking here then

R