TAChart: Update calculated source upon change of the Origin.YCount

git-svn-id: trunk@28779 -
This commit is contained in:
ask 2010-12-20 07:19:59 +00:00
parent 340d1e1ca4
commit d16b7539c1

View File

@ -267,13 +267,14 @@ type
private private
FAccumulationMethod: TChartAccumulationMethod; FAccumulationMethod: TChartAccumulationMethod;
FAccumulationRange: Integer; FAccumulationRange: Integer;
FHistory: array of TChartDataItem;
FIndex: Integer; FIndex: Integer;
FItem: TChartDataItem; FItem: TChartDataItem;
FListener: TListener; FListener: TListener;
FOrigin: TCustomChartSource; FOrigin: TCustomChartSource;
FOriginYCount: Cardinal;
FPercentage: Boolean; FPercentage: Boolean;
FReorderYList: String; FReorderYList: String;
FHistory: array of TChartDataItem;
FYOrder: array of Integer; FYOrder: array of Integer;
procedure CalcAccumulation(AIndex: Integer); procedure CalcAccumulation(AIndex: Integer);
@ -1331,7 +1332,10 @@ end;
procedure TCalculatedChartSource.Changed(ASender: TObject); procedure TCalculatedChartSource.Changed(ASender: TObject);
begin begin
Unused(ASender); if (ASender = FOrigin) and (FOrigin.YCount <> FOriginYCount) then begin
UpdateYOrder;
exit;
end;
FIndex := -1; FIndex := -1;
InvalidateCaches; InvalidateCaches;
Notify; Notify;
@ -1447,6 +1451,7 @@ var
i: Integer; i: Integer;
begin begin
if FOrigin = nil then begin if FOrigin = nil then begin
FOriginYCount := 0;
FYCount := 0; FYCount := 0;
FYOrder := nil; FYOrder := nil;
FItem.YList := nil; FItem.YList := nil;
@ -1454,6 +1459,7 @@ begin
exit; exit;
end; end;
FOriginYCount := FOrigin.YCount;
if ReorderYList = '' then begin if ReorderYList = '' then begin
FYCount := FOrigin.YCount; FYCount := FOrigin.YCount;
SetLength(FYOrder, Max(FYCount - 1, 0)); SetLength(FYOrder, Max(FYCount - 1, 0));