mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-16 02:00:30 +01:00
TAChart: Add per-point legend to the color map demo
git-svn-id: trunk@27741 -
This commit is contained in:
parent
bdeebef80a
commit
beb0cdf7fe
@ -133,7 +133,7 @@ object Form1: TForm1
|
||||
end
|
||||
end
|
||||
object cbInterpolate: TCheckBox
|
||||
Left = 360
|
||||
Left = 352
|
||||
Height = 17
|
||||
Top = 298
|
||||
Width = 74
|
||||
@ -142,6 +142,16 @@ object Form1: TForm1
|
||||
OnChange = cbInterpolateChange
|
||||
TabOrder = 1
|
||||
end
|
||||
object cbMultLegend: TCheckBox
|
||||
Left = 352
|
||||
Height = 17
|
||||
Top = 274
|
||||
Width = 91
|
||||
Anchors = [akRight, akBottom]
|
||||
Caption = 'Expand legend'
|
||||
OnChange = cbMultLegendChange
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
||||
end
|
||||
object UserDefinedChartSource1: TUserDefinedChartSource
|
||||
|
||||
@ -15,6 +15,7 @@ type
|
||||
TForm1 = class(TForm)
|
||||
cbDomain: TCheckBox;
|
||||
cbInterpolate: TCheckBox;
|
||||
cbMultLegend: TCheckBox;
|
||||
Chart1: TChart;
|
||||
Chart1BarSeries1: TBarSeries;
|
||||
Chart1FuncSeries1: TFuncSeries;
|
||||
@ -33,6 +34,7 @@ type
|
||||
UserDefinedChartSource1: TUserDefinedChartSource;
|
||||
procedure cbDomainChange(Sender: TObject);
|
||||
procedure cbInterpolateChange(Sender: TObject);
|
||||
procedure cbMultLegendChange(Sender: TObject);
|
||||
procedure Chart1FuncSeries1Calculate(const AX: Double; out AY: Double);
|
||||
procedure Chart1UserDrawnSeries1Draw(ACanvas: TCanvas; const ARect: TRect);
|
||||
procedure ChartColorMapColorMapSeries1Calculate(const AX, AY: Double; out
|
||||
@ -48,7 +50,7 @@ var
|
||||
implementation
|
||||
|
||||
uses
|
||||
TAChartUtils;
|
||||
TAChartUtils, TALegend;
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
@ -72,6 +74,15 @@ begin
|
||||
ChartColorMapColorMapSeries1.Interpolate := cbInterpolate.Checked;
|
||||
end;
|
||||
|
||||
procedure TForm1.cbMultLegendChange(Sender: TObject);
|
||||
begin
|
||||
with ChartColorMapColorMapSeries1.Legend do
|
||||
if cbMultLegend.Checked then
|
||||
Multiplicity := lmPoint
|
||||
else
|
||||
Multiplicity := lmSingle;
|
||||
end;
|
||||
|
||||
procedure TForm1.Chart1FuncSeries1Calculate(const AX: Double; out AY: Double);
|
||||
begin
|
||||
AY := 1 / Sin(AX);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user