How to paint selected point on 3D surface?

北战南征 提交于 2019-12-08 11:58:34

问题


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


回答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:

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;


来源:https://stackoverflow.com/questions/23466815/how-to-paint-selected-point-on-3d-surface

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!