TContourLevel

TContourLevel
Hierarchy     Properties     Methods     Events     

Unit
TeeSurfa

Description
Contains characteristic information for ContourLevel.
Access levels via TContourLevels collection.

Contour series has a collection of "levels".
Each level has properties to define the level position, pen and color to draw level lines, and a collection of "segments" (array of lines that form the contour level).

procedure TContourSmooth.Chart1AfterDraw(Sender: TObject);
var tmpLevel : Integer;
tmpSegment : Integer;
P : TPoint;
tmp : Integer;
begin
// Draw small points at contour level segment lines...
Chart1.Canvas.Brush.Color:=clBlack;
Chart1.Canvas.Pen.Color:=clGreen;

with Series1.Levels do
for tmpLevel:=0 to Count-1 do // for each level..
with Items[tmpLevel] do
for tmpSegment:=0 to SegmentCount-1 do // for each segment in level...
with Segments[tmpSegment] do
begin
for tmp:=0 to Length(Points)-1 do // for each point in segment...
begin
// Convert to screen coordinates...
P.X:=Series1.GetHorizAxis.CalcXPosValue(Points[tmp].X);
P.Y:=Series1.GetVertAxis.CalcYPosValue(Points[tmp].Y);

// Draw point...
Chart1.Canvas.Rectangle(P.X-2,P.Y-2,P.X+2,P.Y+2);
end;
end;
end;