0

How can I paint selected point on TeeChart 3D Surface?

Example

Sir Rufo
  • 18,395
  • 2
  • 39
  • 73
Xeno
  • 1
  • 1
  • I tried to find standard methods or properties to show selected point, but this series don't have this. Other way, but wrong, is add two line-series, but they can not move on z axis (and x axis, if perpendicular). I don't have source code of TeeChart, to look how does it implemented at Surface Nearest Tool. – Xeno May 05 '14 at 08:44

1 Answers1

1
  • If you want to highlight the cell below the mouse, you can use the TSurfaceNearestTool to highlight a TSurfaceSeries cell like in the example at "All Features\Welcome !\Tools\Surface Nearest" in the Features Demo program:

SurfaceNearest

The Features Demo program (Tee9New.exe) is shipped with the installation of the component, and you can alternatively download the "TeeChart compiled demo" here.

You just have to create the tool and assign a surface to it. Ie:

uses TeeSurfaceTool, TeeSurfa;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.AddSeries(TSurfaceSeries).FillSampleValues;

  (Chart1.Tools.Add(TSurfaceNearestTool) as TSurfaceNearestTool).Series:=Chart1[0];
end;
  • If you know the ValueIndex of the cell to highlight, you can just change the ValueColor[ValueIndex] property. Ie:
uses TeeSurfa, TeeTools;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin    
  Chart1.Aspect.Zoom:=80;
  Chart1.Chart3DPercent:=100;

  with Chart1.AddSeries(TSurfaceSeries) as TSurfaceSeries do
  begin
    FillSampleValues;

    UseColorRange:=false;
    UsePalette:=false;
    for i:=0 to Count-1 do
      if (i mod 2 = 0) then
        ValueColor[i]:=clGreen;
  end;
end;
Yeray
  • 5,009
  • 1
  • 13
  • 25