mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 10:35:58 +02:00
TAChart: Use custom series enumerator in TChartListbox
git-svn-id: trunk@31678 -
This commit is contained in:
parent
609137625e
commit
ff5131c97b
@ -189,7 +189,7 @@ implementation
|
||||
|
||||
uses
|
||||
Math, LCLIntf, LCLType, SysUtils, Themes,
|
||||
TACustomSource, TADrawerCanvas, TADrawUtils, TAGeometry;
|
||||
TACustomSource, TADrawerCanvas, TADrawUtils, TAEnumerators, TAGeometry;
|
||||
|
||||
procedure Register;
|
||||
begin
|
||||
@ -260,21 +260,20 @@ function TChartListbox.CreateLegendItems: TChartLegendItems;
|
||||
all series contained in the Chart. In case of MultiLegend items, only
|
||||
a single legend item is used }
|
||||
var
|
||||
i: Integer;
|
||||
skip: Boolean;
|
||||
s: TCustomChartSeries;
|
||||
begin
|
||||
Result := TChartLegendItems.Create;
|
||||
try
|
||||
if FChart = nil then exit;
|
||||
for i := 0 to FChart.SeriesCount - 1 do
|
||||
if FChart.Series[i] is TCustomChartSeries then begin
|
||||
if Assigned(OnAddSeries) then begin
|
||||
skip := false;
|
||||
FOnAddSeries(Self, TCustomChartSeries(FChart.Series[i]), Result, skip);
|
||||
if skip then continue;
|
||||
end;
|
||||
TCustomChartSeries(FChart.Series[i]).GetSingleLegendItem(Result);
|
||||
for s in CustomSeries(Chart) do begin
|
||||
if Assigned(OnAddSeries) then begin
|
||||
skip := false;
|
||||
FOnAddSeries(Self, s, Result, skip);
|
||||
if skip then continue;
|
||||
end;
|
||||
s.GetSingleLegendItem(Result);
|
||||
end;
|
||||
except
|
||||
FreeAndNil(Result);
|
||||
raise;
|
||||
|
@ -100,6 +100,7 @@ constructor TFilteredChartSeriesEnumerator.Create(
|
||||
AFactory: TBasicFilteredChartSeriesEnumeratorFactory);
|
||||
begin
|
||||
FFactory := AFactory;
|
||||
FPosition := -1;
|
||||
end;
|
||||
|
||||
destructor TFilteredChartSeriesEnumerator.Destroy;
|
||||
|
Loading…
Reference in New Issue
Block a user