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