mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-14 20:12:50 +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;
|
FPointer: TSeriesPointer;
|
||||||
FShowPoints: Boolean;
|
FShowPoints: Boolean;
|
||||||
|
|
||||||
|
procedure DrawSingleLineInStack(ACanvas: TCanvas);
|
||||||
function GetShowLines: Boolean;
|
function GetShowLines: Boolean;
|
||||||
procedure SetLinePen(AValue: TPen);
|
procedure SetLinePen(AValue: TPen);
|
||||||
procedure SetLineType(AValue: TLineType);
|
procedure SetLineType(AValue: TLineType);
|
||||||
@ -363,6 +364,21 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TLineSeries.Draw(ACanvas: TCanvas);
|
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
|
var
|
||||||
points: array of TPoint;
|
points: array of TPoint;
|
||||||
pointCount: Integer = 0;
|
pointCount: Integer = 0;
|
||||||
@ -443,18 +459,8 @@ var
|
|||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
ai: TPoint;
|
ai: TPoint;
|
||||||
ext: TDoubleRect;
|
|
||||||
p: TDoublePoint;
|
p: TDoublePoint;
|
||||||
begin
|
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;
|
DrawLines;
|
||||||
DrawLabels(ACanvas);
|
DrawLabels(ACanvas);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user