forked from academiadocodigo/TBGWebCharts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Charts.Legends.Labels.pas
144 lines (121 loc) · 3.4 KB
/
Charts.Legends.Labels.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
unit Charts.Legends.Labels;
interface
uses
Interfaces;
type
TModelHTMLLegendsLabels<T : IInterface> = class(TInterfacedObject, iModelHTMLLegendLabels<T>)
private
FParent : T;
FfontSize : Integer;
FfontStyle : String;
FfontColorHEX : String;
FfontFamily : String;
Fpadding : Integer;
public
constructor Create(Parent : T);
destructor Destroy; override;
class function New(Parent : T) : iModelHTMLLegendLabels<T>;
function fontSize (Value : Integer) : iModelHTMLLegendLabels<T>; overload;
function fontSize : Integer; overload;
function fontStyle ( Value : String ) : iModelHTMLLegendLabels<T>; overload;
function fontStyle : String; overload;
function fontColorHEX ( Value : String ) : iModelHTMLLegendLabels<T>; overload;
function fontColorHEX : String; overload;
function fontFamily ( Value : String ) : iModelHTMLLegendLabels<T>; overload;
function fontFamily : String; overload;
function padding ( Value : Integer ) : iModelHTMLLegendLabels<T>; overload;
function padding : Integer; overload;
function Result : String;
function &End : T;
end;
implementation
uses
System.SysUtils, Injection;
{ TModelHTMLLegendsLabels }
function TModelHTMLLegendsLabels<T>.&End: T;
begin
Result := FParent;
end;
function TModelHTMLLegendsLabels<T>.fontColorHEX: String;
begin
Result := FfontColorHEX;
end;
function TModelHTMLLegendsLabels<T>.fontFamily: String;
begin
Result := FfontFamily;
end;
function TModelHTMLLegendsLabels<T>.fontFamily(
Value: String): iModelHTMLLegendLabels<T>;
begin
Result := Self;
FfontFamily := Value;
end;
function TModelHTMLLegendsLabels<T>.fontColorHEX(
Value: String): iModelHTMLLegendLabels<T>;
begin
Result := Self;
FfontColorHEX := Value;
end;
function TModelHTMLLegendsLabels<T>.fontSize: Integer;
begin
Result := FfontSize;
end;
function TModelHTMLLegendsLabels<T>.fontStyle: String;
begin
Result := FfontStyle;
end;
function TModelHTMLLegendsLabels<T>.fontStyle(
Value: String): iModelHTMLLegendLabels<T>;
begin
Result := Self;
FfontStyle := Value;
end;
function TModelHTMLLegendsLabels<T>.fontSize(
Value: Integer): iModelHTMLLegendLabels<T>;
begin
Result := Self;
FfontSize := Value;
end;
constructor TModelHTMLLegendsLabels<T>.Create(Parent : T);
begin
{$IF RTLVERSION > 27 }
TInjection.Weak(@FParent, Parent);
{$ELSE}
FParent := Parent;
{$IFEND}
FfontSize := 12;
FfontStyle := 'normal';
FfontColorHEX := '#666';
FfontFamily := 'Arial';
Fpadding := 10;
end;
destructor TModelHTMLLegendsLabels<T>.Destroy;
begin
inherited;
end;
class function TModelHTMLLegendsLabels<T>.New(Parent : T): iModelHTMLLegendLabels<T>;
begin
Result := Self.Create(Parent);
end;
function TModelHTMLLegendsLabels<T>.padding: Integer;
begin
Result := Fpadding;
end;
function TModelHTMLLegendsLabels<T>.padding(
Value: Integer): iModelHTMLLegendLabels<T>;
begin
Result := Self;
Fpadding := Value;
end;
function TModelHTMLLegendsLabels<T>.Result: String;
begin
Result := '';
Result := Result + 'labels : { ';
Result := Result + 'fontSize : ' + IntToStr(FfontSize) + ', ';
Result := Result + 'fontColor : "'+FfontColorHEX+'",';
Result := Result + 'fontFamily : "'+FfontFamily+'",';
Result := Result + 'padding : ' + IntToStr(Fpadding) + ', ';
Result := Result + 'fontStyle : "'+FfontStyle+'"';
Result := Result + '},';
end;
end.