TAChart: Fix TCubicSplineSeries drawing nothing if there are less than 4 data points and the option csoDrawFewPoints is set.

git-svn-id: trunk@57634 -
This commit is contained in:
wp 2018-04-09 17:09:00 +00:00
parent dd35516710
commit 5ce61895bf
2 changed files with 7 additions and 3 deletions

View File

@ -94,7 +94,7 @@ type
FAssignOp: String; FAssignOp: String;
FCurIndent: integer; FCurIndent: integer;
FCurrentPos: Integer; FCurrentPos: Integer;
FDefaultDefineProperties: CodePointer; FDefaultDefineProperties: Pointer; //CodePointer;
FExecCustomProc: string; FExecCustomProc: string;
FExecCustomProcUnit: string; FExecCustomProcUnit: string;
FIgnoreChildren: Boolean; FIgnoreChildren: Boolean;

View File

@ -1296,6 +1296,7 @@ var
r: Integer = 0; r: Integer = 0;
minv, maxv: ArbFloat; minv, maxv: ArbFloat;
extY: TDoubleInterval = (FStart: Infinity; FEnd: NegInfinity); extY: TDoubleInterval = (FStart: Infinity; FEnd: NegInfinity);
extChg: Boolean = false;
s: TSpline; s: TSpline;
begin begin
Result := inherited Extent; Result := inherited Extent;
@ -1309,9 +1310,12 @@ begin
ipfsmm(High(s.FCoeff), s.FX[0], s.FY[0], s.FCoeff[0], minv, maxv, r); ipfsmm(High(s.FCoeff), s.FX[0], s.FY[0], s.FCoeff[0], minv, maxv, r);
extY.FStart := Min(minv, extY.FStart); extY.FStart := Min(minv, extY.FStart);
extY.FEnd := Max(maxv, extY.FEnd); extY.FEnd := Max(maxv, extY.FEnd);
extChg := true;
end;
if extChg then begin
Result.a.Y := extY.FStart;
Result.b.Y := extY.FEnd;
end; end;
Result.a.Y := extY.FStart;
Result.b.Y := extY.FEnd;
end; end;
procedure TCubicSplineSeries.FreeSplines; procedure TCubicSplineSeries.FreeSplines;