mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-14 13:52:39 +02:00
TAChart: Extract TLineSeries.DrawSingleLineInStack procedure
git-svn-id: trunk@27130 -
This commit is contained in:
parent
73ef160d47
commit
823ef24846
@ -164,6 +164,7 @@ type
|
||||
FPointer: TSeriesPointer;
|
||||
FShowPoints: Boolean;
|
||||
|
||||
procedure DrawSingleLineInStack(ACanvas: TCanvas);
|
||||
function GetShowLines: Boolean;
|
||||
procedure SetLinePen(AValue: TPen);
|
||||
procedure SetLineType(AValue: TLineType);
|
||||
@ -363,6 +364,21 @@ begin
|
||||
end;
|
||||
|
||||
procedure TLineSeries.Draw(ACanvas: TCanvas);
|
||||
var
|
||||
ext: TDoubleRect;
|
||||
begin
|
||||
// Do not draw anything if the series extent does not intersect CurrentExtent.
|
||||
ext.a := AxisToGraph(Source.Extent.a);
|
||||
ext.b := AxisToGraph(Source.Extent.b);
|
||||
if LineType = ltFromOrigin then
|
||||
ExpandRect(ext, AxisToGraph(ZeroDoublePoint));
|
||||
if not RectIntersectsRect(ext, ParentChart.CurrentExtent) then exit;
|
||||
|
||||
PrepareGraphPoints(ext, LineType <> ltFromOrigin);
|
||||
DrawSingleLineInStack(ACanvas);
|
||||
end;
|
||||
|
||||
procedure TLineSeries.DrawSingleLineInStack(ACanvas: TCanvas);
|
||||
var
|
||||
points: array of TPoint;
|
||||
pointCount: Integer = 0;
|
||||
@ -443,18 +459,8 @@ var
|
||||
var
|
||||
i: Integer;
|
||||
ai: TPoint;
|
||||
ext: TDoubleRect;
|
||||
p: TDoublePoint;
|
||||
begin
|
||||
// Do not draw anything if the series extent does not intersect CurrentExtent.
|
||||
ext.a := AxisToGraph(Source.Extent.a);
|
||||
ext.b := AxisToGraph(Source.Extent.b);
|
||||
if LineType = ltFromOrigin then
|
||||
ExpandRect(ext, AxisToGraph(ZeroDoublePoint));
|
||||
if not RectIntersectsRect(ext, ParentChart.CurrentExtent) then exit;
|
||||
|
||||
PrepareGraphPoints(ext, LineType <> ltFromOrigin);
|
||||
|
||||
DrawLines;
|
||||
DrawLabels(ACanvas);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user