You've already forked lazarus-ccr
NiceChart: Activate clipping at the chart box boundaries.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8862 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1471,37 +1471,49 @@ begin
|
||||
AutoColors(ACanvas, Index, sr.FKind = skBar);
|
||||
with ACanvas do
|
||||
begin
|
||||
ClipRect := RcChart;
|
||||
if (sr.FKind = skBar) then
|
||||
begin
|
||||
Pen.Width := 1;
|
||||
for x := 0 to Sr.Values.Count-1 do
|
||||
begin
|
||||
P := PXYInfo(Sr.Values[x]);
|
||||
Rectangle(P^.Rc);
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
if (sr.FKind = skLine) then
|
||||
begin
|
||||
Pen.Width := sr.LineWidth;
|
||||
Clipping := true;
|
||||
try
|
||||
Pen.Width := 1;
|
||||
for x := 0 to Sr.Values.Count-1 do
|
||||
begin
|
||||
P := PXYInfo(Sr.Values[x]);
|
||||
if (x = 0)
|
||||
then MoveTo(P^.Px, P^.Py)
|
||||
else LineTo(P^.Px, P^.Py);
|
||||
Rectangle(P^.Rc);
|
||||
end;
|
||||
end else
|
||||
if (sr.FKind = skSmooth) then
|
||||
begin
|
||||
Pen.Width := sr.LineWidth;
|
||||
sr.Spline.Draw(ACanvas);
|
||||
finally
|
||||
Clipping := false;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
Clipping := true;
|
||||
try
|
||||
if (sr.FKind = skLine) then
|
||||
begin
|
||||
Pen.Width := sr.LineWidth;
|
||||
for x := 0 to Sr.Values.Count-1 do
|
||||
begin
|
||||
P := PXYInfo(Sr.Values[x]);
|
||||
if (x = 0)
|
||||
then MoveTo(P^.Px, P^.Py)
|
||||
else LineTo(P^.Px, P^.Py);
|
||||
end;
|
||||
end else
|
||||
if (sr.FKind = skSmooth) then
|
||||
begin
|
||||
Pen.Width := sr.LineWidth;
|
||||
sr.Spline.Draw(ACanvas);
|
||||
end;
|
||||
finally
|
||||
Clipping := false;
|
||||
end;
|
||||
Pen.Width := 1;
|
||||
for x := 0 to Sr.Values.Count-1 do
|
||||
begin
|
||||
P := PXYInfo(Sr.Values[x]);
|
||||
Marker(ACanvas, P^.Px, P^.Py, MarkSize);
|
||||
if PtInRect(RcChart, Point(P^.Px, P^.Py)) then
|
||||
Marker(ACanvas, P^.Px, P^.Py, MarkSize);
|
||||
end;
|
||||
end;
|
||||
if FShowLegend then
|
||||
|
Reference in New Issue
Block a user