mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-18 13:07:14 +02:00
TAChart: Support Y NaNs in polar series
git-svn-id: trunk@38547 -
This commit is contained in:
parent
1c453ed8bf
commit
b12d54bac4
@ -548,19 +548,36 @@ end;
|
|||||||
procedure TPolarSeries.Draw(ADrawer: IChartDrawer);
|
procedure TPolarSeries.Draw(ADrawer: IChartDrawer);
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
cnt: Integer = 0;
|
||||||
pts: TPointArray;
|
pts: TPointArray;
|
||||||
|
gp: TDoublePoint;
|
||||||
|
firstPoint, lastPoint: TPoint;
|
||||||
|
firstPointSet: Boolean = false;
|
||||||
begin
|
begin
|
||||||
PrepareAngleCache;
|
PrepareAngleCache;
|
||||||
SetLength(pts, Count);
|
SetLength(pts, Count);
|
||||||
for i := 0 to Count - 1 do
|
|
||||||
pts[i] := FChart.GraphToImage(GraphPoint(i));
|
|
||||||
ADrawer.Pen := LinePen;
|
ADrawer.Pen := LinePen;
|
||||||
if CloseCircle then begin
|
for i := 0 to Count - 1 do begin
|
||||||
ADrawer.SetBrushParams(bsClear, clTAColor);
|
gp := GraphPoint(i);
|
||||||
ADrawer.Polygon(pts, 0, Length(pts));
|
if IsNan(gp) then begin
|
||||||
end
|
if cnt > 0 then
|
||||||
else
|
ADrawer.Polyline(pts, 0, cnt);
|
||||||
ADrawer.Polyline(pts, 0, Length(pts));
|
cnt := 0;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
lastPoint := FChart.GraphToImage(gp);
|
||||||
|
pts[cnt] := lastPoint;
|
||||||
|
cnt += 1;
|
||||||
|
if not firstPointSet then begin
|
||||||
|
firstPoint := lastPoint;
|
||||||
|
firstPointSet := true;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
if cnt > 0 then
|
||||||
|
ADrawer.Polyline(pts, 0, cnt);
|
||||||
|
if firstPointSet and CloseCircle then
|
||||||
|
ADrawer.Line(lastPoint, firstPoint);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPolarSeries.Extent: TDoubleRect;
|
function TPolarSeries.Extent: TDoubleRect;
|
||||||
|
Loading…
Reference in New Issue
Block a user