mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-05 11:40:18 +02:00
TAChart: Skip leftmost point and points with dx = 0 in derivative source
git-svn-id: trunk@32324 -
This commit is contained in:
parent
6f963be4f2
commit
04b8a56aa0
@ -913,20 +913,19 @@ var
|
||||
prevItem: PChartDataItem;
|
||||
i, j, ar: Integer;
|
||||
dx: Double;
|
||||
t: TChartDataItem;
|
||||
begin
|
||||
if AIndex = 0 then begin
|
||||
AIndex := 1;
|
||||
ExtractItem(t, AIndex);
|
||||
FHistory.AddLast(t);
|
||||
dx := t.X - FHistory.GetPLast(1)^.X;
|
||||
end
|
||||
else
|
||||
dx := FItem.X - FHistory.GetPLast(1)^.X;
|
||||
FItem.ClearY;
|
||||
if dx = 0 then exit;
|
||||
if AIndex = 0 then begin
|
||||
FItem.X := SafeNan;
|
||||
exit;
|
||||
end;
|
||||
dx := FItem.X - FHistory.GetPLast(1)^.X;
|
||||
if dx = 0 then begin
|
||||
FItem.X := SafeNan;
|
||||
exit;
|
||||
end;
|
||||
ar := IfThen(AccumulationRange = 0, MaxInt, AccumulationRange);
|
||||
ar := math.MinValue([ar, Integer(AIndex + 1), High(COEFFS)]);
|
||||
ar := MinValue([ar, Integer(AIndex + 1), High(COEFFS)]);
|
||||
for j := 0 to ar - 1 do begin
|
||||
prevItem := FHistory.GetPLast(j);
|
||||
FItem.Y += prevItem^.Y * COEFFS[ar, j];
|
||||
|
Loading…
Reference in New Issue
Block a user