mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-27 15:40:40 +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
|
uses
|
||||||
Math, LCLIntf, LCLType, SysUtils, Themes,
|
Math, LCLIntf, LCLType, SysUtils, Themes,
|
||||||
TACustomSource, TADrawerCanvas, TADrawUtils, TAGeometry;
|
TACustomSource, TADrawerCanvas, TADrawUtils, TAEnumerators, TAGeometry;
|
||||||
|
|
||||||
procedure Register;
|
procedure Register;
|
||||||
begin
|
begin
|
||||||
@ -260,21 +260,20 @@ function TChartListbox.CreateLegendItems: TChartLegendItems;
|
|||||||
all series contained in the Chart. In case of MultiLegend items, only
|
all series contained in the Chart. In case of MultiLegend items, only
|
||||||
a single legend item is used }
|
a single legend item is used }
|
||||||
var
|
var
|
||||||
i: Integer;
|
|
||||||
skip: Boolean;
|
skip: Boolean;
|
||||||
|
s: TCustomChartSeries;
|
||||||
begin
|
begin
|
||||||
Result := TChartLegendItems.Create;
|
Result := TChartLegendItems.Create;
|
||||||
try
|
try
|
||||||
if FChart = nil then exit;
|
if FChart = nil then exit;
|
||||||
for i := 0 to FChart.SeriesCount - 1 do
|
for s in CustomSeries(Chart) do begin
|
||||||
if FChart.Series[i] is TCustomChartSeries then begin
|
if Assigned(OnAddSeries) then begin
|
||||||
if Assigned(OnAddSeries) then begin
|
skip := false;
|
||||||
skip := false;
|
FOnAddSeries(Self, s, Result, skip);
|
||||||
FOnAddSeries(Self, TCustomChartSeries(FChart.Series[i]), Result, skip);
|
if skip then continue;
|
||||||
if skip then continue;
|
|
||||||
end;
|
|
||||||
TCustomChartSeries(FChart.Series[i]).GetSingleLegendItem(Result);
|
|
||||||
end;
|
end;
|
||||||
|
s.GetSingleLegendItem(Result);
|
||||||
|
end;
|
||||||
except
|
except
|
||||||
FreeAndNil(Result);
|
FreeAndNil(Result);
|
||||||
raise;
|
raise;
|
||||||
|
@ -100,6 +100,7 @@ constructor TFilteredChartSeriesEnumerator.Create(
|
|||||||
AFactory: TBasicFilteredChartSeriesEnumeratorFactory);
|
AFactory: TBasicFilteredChartSeriesEnumeratorFactory);
|
||||||
begin
|
begin
|
||||||
FFactory := AFactory;
|
FFactory := AFactory;
|
||||||
|
FPosition := -1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TFilteredChartSeriesEnumerator.Destroy;
|
destructor TFilteredChartSeriesEnumerator.Destroy;
|
||||||
|
Loading…
Reference in New Issue
Block a user