另一种选择是使用两个TSurfaceSeries。即:
uses TeeSurfa, Math;
var topSurface, bottomSurface: TSurfaceSeries;
procedure TForm1.FormCreate(Sender: TObject);
var nRev, countZ, i, z: Integer;
alpha, x, y: Double;
begin
Chart1.Legend.Visible:=False;
Chart1.Chart3DPercent:=100;
Chart1.Aspect.Orthogonal:=False;
Chart1.Aspect.Zoom:=80;
Chart1.Aspect.Rotation:=320;
Chart1.Aspect.Elevation:=350;
Chart1.Walls.Visible:=False;
Chart1.Axes.Visible:=False;
nRev:=50;
countZ:=20;
bottomSurface:=Chart1.AddSeries(TSurfaceSeries) as TSurfaceSeries;
topSurface:=Chart1.AddSeries(TSurfaceSeries) as TSurfaceSeries;
topSurface.IrregularGrid:=True;
topSurface.XValues.Order:=loNone;
topSurface.YValues.Order:=loNone;
topSurface.Pen.Color:=Chart1.Canvas.ColorFrom(bottomSurface.Pen.Color,150);
bottomSurface.IrregularGrid:=True;
bottomSurface.XValues.Order:=loNone;
bottomSurface.YValues.Order:=loNone;
bottomSurface.Pen.Color:=Chart1.Canvas.ColorFrom(bottomSurface.Pen.Color,150);
for z:=0 to countZ-1 do
begin
for i:=0 to nRev-1 do
begin
alpha:=DegToRad(i*360/nRev);
x:=Cos(alpha);
y:=Sin(alpha);
if alpha<DegToRad(180) then
topSurface.AddXYZ(x, y, z, '', RGB(random(255), random(255), random(255)))
else
bottomSurface.AddXYZ(x, y, z, '', RGB(random(255), random(255), random(255)));
end;
bottomSurface.AddXYZ(topSurface.XValues.MaxValue, Sin(ArcCos(topSurface.XValues.MaxValue)), z, '', RGB(random(255), random(255), random(255)));
bottomSurface.AddXYZ(topSurface.XValues.MinValue, Sin(ArcCos(topSurface.XValues.MinValue)), z, '', RGB(random(255), random(255), random(255)));
end;
end;