mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 17:20:37 +02:00
TAChart: Fix drawing of pie series with data from the db source
git-svn-id: trunk@38737 -
This commit is contained in:
parent
d510d4d1a8
commit
1cdc9e4f16
@ -491,19 +491,22 @@ var
|
||||
i, j: Integer;
|
||||
di: PChartDataItem;
|
||||
prevAngle: Double = 0;
|
||||
a: Double;
|
||||
a, total: Double;
|
||||
begin
|
||||
Result.TopLeft := FCenter;
|
||||
Result.BottomRight := FCenter;
|
||||
SetLength(FSlices, Count);
|
||||
j := 0;
|
||||
// This is a workaround for db source invalidating the cache due to
|
||||
// unnecessary "dataset changed" events.
|
||||
total := Source.ValuesTotal;
|
||||
for i := 0 to Count - 1 do begin
|
||||
di := Source[i];
|
||||
if IsNan(di^.Y) then continue;
|
||||
with FSlices[j] do begin
|
||||
FOrigIndex := i;
|
||||
FPrevAngle := prevAngle;
|
||||
FNextAngle := FPrevAngle + CycleToRad(di^.Y / Source.ValuesTotal);
|
||||
FNextAngle := FPrevAngle + CycleToRad(di^.Y / total);
|
||||
FVisible := not IsNan(di^.X);
|
||||
if FVisible then begin
|
||||
FBase := FCenter;
|
||||
|
Loading…
Reference in New Issue
Block a user