File tree 16 files changed +420
-228
lines changed
16 files changed +420
-228
lines changed Original file line number Diff line number Diff line change @@ -174,11 +174,13 @@ interface ComponentAnimateCfg {
174
174
readonly delay? : number ;
175
175
}
176
176
// 配置参考
177
- animateOption : {
178
- appear : ComponentAnimateCfg ;
179
- update : ComponentAnimateCfg ;
180
- enter : ComponentAnimateCfg ;
181
- leave : ComponentAnimateCfg ;
177
+ {
178
+ animateOption : {
179
+ appear : ComponentAnimateCfg ;
180
+ update : ComponentAnimateCfg ;
181
+ enter : ComponentAnimateCfg ;
182
+ leave : ComponentAnimateCfg ;
183
+ }
182
184
}
183
185
```
184
186
Original file line number Diff line number Diff line change @@ -174,11 +174,13 @@ interface ComponentAnimateCfg {
174
174
readonly delay? : number ;
175
175
}
176
176
// 配置参考
177
- animateOption : {
178
- appear : ComponentAnimateCfg ;
179
- update : ComponentAnimateCfg ;
180
- enter : ComponentAnimateCfg ;
181
- leave : ComponentAnimateCfg ;
177
+ {
178
+ animateOption : {
179
+ appear : ComponentAnimateCfg ;
180
+ update : ComponentAnimateCfg ;
181
+ enter : ComponentAnimateCfg ;
182
+ leave : ComponentAnimateCfg ;
183
+ }
182
184
}
183
185
```
184
186
Original file line number Diff line number Diff line change
1
+ #### render() 📌
2
+
3
+ <description >** 必选** </description >
4
+
5
+ 功能描述:渲染图表。
6
+
7
+ 默认配置:` 无 `
8
+
9
+ #### update()
10
+
11
+ <description >** 可选** </description >
12
+
13
+ 功能描述:更新图表配置项,配置覆盖,不会做差异比对。
14
+
15
+ 默认配置:` 无 `
16
+
17
+ 使用示例:
18
+
19
+ ``` ts
20
+ plot .update ({
21
+ ... currentConfig ,
22
+ legend: false ,
23
+ });
24
+ ```
25
+
26
+ #### changeData()
27
+
28
+ <description >** 可选** </description >
29
+
30
+ 功能描述:更新图表数据。` update() ` 方法会导致图形区域销毁并重建,如果只进行数据更新,而不涉及其他配置项更新,推荐使用本方法。。
31
+
32
+ 默认配置:` 无 `
33
+
34
+ 使用示例:
35
+
36
+ ``` ts
37
+ plot .changeData (newData );
38
+ ```
Original file line number Diff line number Diff line change
1
+ #### render() 📌
2
+
3
+ <description >** 必选** </description >
4
+
5
+ 功能描述:渲染图表。
6
+
7
+ 默认配置:` 无 `
8
+
9
+ #### update()
10
+
11
+ <description >** 可选** </description >
12
+
13
+ 功能描述:更新图表配置项,配置覆盖,不会做差异比对。
14
+
15
+ 默认配置:` 无 `
16
+
17
+ 使用示例:
18
+
19
+ ``` ts
20
+ plot .update ({
21
+ ... currentConfig ,
22
+ legend: false ,
23
+ });
24
+ ```
25
+
26
+ #### changeData()
27
+
28
+ <description >** 可选** </description >
29
+
30
+ 功能描述:更新图表数据。` update() ` 方法会导致图形区域销毁并重建,如果只进行数据更新,而不涉及其他配置项更新,推荐使用本方法。。
31
+
32
+ 默认配置:` 无 `
33
+
34
+ 使用示例:
35
+
36
+ ``` ts
37
+ plot .changeData (newData );
38
+ ```
Original file line number Diff line number Diff line change 12
12
13
13
示例代码:
14
14
15
- ``` js
16
- label: {
17
- style: {
18
- fill: ' red' ,
19
- opacity: 0.6 ,
20
- fontSize: 24
21
- },
22
- rotate: true
15
+ ``` ts
16
+ {
17
+ label : {
18
+ style : {
19
+ fill : ' red' ,
20
+ opacity : 0.6 ,
21
+ fontSize : 24
22
+ },
23
+ rotate : true
24
+ }
23
25
}
24
26
```
Original file line number Diff line number Diff line change 12
12
13
13
示例代码:
14
14
15
- ``` js
16
- label: {
17
- style: {
18
- fill: ' red' ,
19
- opacity: 0.6 ,
20
- fontSize: 24
21
- },
22
- rotate: true
15
+ ``` ts
16
+ {
17
+ label : {
18
+ style : {
19
+ fill : ' red' ,
20
+ opacity : 0.6 ,
21
+ fontSize : 24
22
+ },
23
+ rotate : true
24
+ }
23
25
}
24
26
```
Original file line number Diff line number Diff line change 14
14
15
15
示例代码:
16
16
17
- ``` js
18
- xAxis: {
19
- grid: {
20
- line: {
21
- style: {
22
- stroke: ' black' ,
23
- lineWidth: 2 ,
24
- lineDash: [4 , 5 ],
25
- strokeOpacity: 0.7 ,
26
- shadowColor: ' black' ,
27
- shadowBlur: 10 ,
28
- shadowOffsetX: 5 ,
29
- shadowOffsetY: 5 ,
30
- cursor: ' pointer'
17
+ ``` ts
18
+ {
19
+ xAxis : {
20
+ grid : {
21
+ line : {
22
+ style : {
23
+ stroke : ' black' ,
24
+ lineWidth : 2 ,
25
+ lineDash : [4 , 5 ],
26
+ strokeOpacity : 0.7 ,
27
+ shadowColor : ' black' ,
28
+ shadowBlur : 10 ,
29
+ shadowOffsetX : 5 ,
30
+ shadowOffsetY : 5 ,
31
+ cursor : ' pointer'
32
+ }
31
33
}
32
34
}
33
35
}
Original file line number Diff line number Diff line change 14
14
15
15
示例代码:
16
16
17
- ``` js
18
- xAxis: {
19
- grid: {
20
- line: {
21
- style: {
22
- stroke: ' black' ,
23
- lineWidth: 2 ,
24
- lineDash: [4 , 5 ],
25
- strokeOpacity: 0.7 ,
26
- shadowColor: ' black' ,
27
- shadowBlur: 10 ,
28
- shadowOffsetX: 5 ,
29
- shadowOffsetY: 5 ,
30
- cursor: ' pointer'
17
+ ``` ts
18
+ {
19
+ xAxis : {
20
+ grid : {
21
+ line : {
22
+ style : {
23
+ stroke : ' black' ,
24
+ lineWidth : 2 ,
25
+ lineDash : [4 , 5 ],
26
+ strokeOpacity : 0.7 ,
27
+ shadowColor : ' black' ,
28
+ shadowBlur : 10 ,
29
+ shadowOffsetX : 5 ,
30
+ shadowOffsetY : 5 ,
31
+ cursor : ' pointer'
32
+ }
31
33
}
32
34
}
33
35
}
Original file line number Diff line number Diff line change 17
17
18
18
示例代码:
19
19
20
- ``` js
20
+ ``` ts
21
+ {
21
22
pointStyle : {
22
23
fill : ' red' ,
23
24
fillOpacity : 0.5 ,
31
32
shadowOffsetY : 5 ,
32
33
cursor : ' pointer'
33
34
}
35
+ }
34
36
```
Original file line number Diff line number Diff line change 17
17
18
18
示例代码:
19
19
20
- ``` js
20
+ ``` ts
21
+ {
21
22
pointStyle : {
22
23
fill : ' red' ,
23
24
fillOpacity : 0.5 ,
31
32
shadowOffsetY : 5 ,
32
33
cursor : ' pointer'
33
34
}
35
+ }
34
36
```
Original file line number Diff line number Diff line change 22
22
23
23
示例代码,以 label.style 配置为例:
24
24
25
- ``` js
26
- label: {
27
- style: {
28
- fontSize: 80 ,
29
- fontWeight: 300 ,
30
- textAlign: ' center' ,
31
- textBaseline: ' middle' ,
32
- shadowColor: ' white' ,
33
- shadowBlur: 10 ,
25
+ ``` ts
26
+ {
27
+ label : {
28
+ style :{
29
+ fontSize : 80 ,
30
+ fontWeight : 300 ,
31
+ textAlign : ' center' ,
32
+ textBaseline : ' middle' ,
33
+ shadowColor : ' white' ,
34
+ shadowBlur : 10 ,
35
+ }
34
36
}
35
37
}
36
38
```
Original file line number Diff line number Diff line change 22
22
23
23
示例代码,以 label.style 配置为例:
24
24
25
- ``` js
26
- label: {
27
- style: {
28
- fontSize: 80 ,
29
- fontWeight: 300 ,
30
- textAlign: ' center' ,
31
- textBaseline: ' middle' ,
32
- shadowColor: ' white' ,
33
- shadowBlur: 10 ,
25
+ ``` ts
26
+ {
27
+ label : {
28
+ style :{
29
+ fontSize : 80 ,
30
+ fontWeight : 300 ,
31
+ textAlign : ' center' ,
32
+ textBaseline : ' middle' ,
33
+ shadowColor : ' white' ,
34
+ shadowBlur : 10 ,
35
+ }
34
36
}
35
37
}
36
38
```
Original file line number Diff line number Diff line change 143
143
144
144
默认配置: ` 无 `
145
145
146
- ``` js
147
- /** 通用对象 */
148
- export interface LooseObject {
149
- [key : string ]: any ;
150
- }
146
+ ``` ts
151
147
/** Tooltip 内容框的 css 样式定义 */
152
- export interface TooltipDomStyles {
153
- 'g2 -tooltip '?: LooseObject ;
154
- 'g2 -tooltip -title '?: LooseObject ;
155
- 'g2 -tooltip -list '?: LooseObject ;
156
- 'g2 -tooltip -list -item '?: LooseObject ;
157
- 'g2 -tooltip -marker '?: LooseObject ;
158
- 'g2 -tooltip -value '?: LooseObject ;
159
- 'g2 -tooltip -name '?: LooseObject ;
148
+ {
149
+ domStyles : {
150
+ ' g2-tooltip' ?: object ;
151
+ ' g2-tooltip-title' ?: object ;
152
+ ' g2-tooltip-list' ?: object ;
153
+ ' g2-tooltip-list-item' ?: object ;
154
+ ' g2-tooltip-marker' ?: object ;
155
+ ' g2-tooltip-value' ?: object ;
156
+ ' g2-tooltip-name' ?: object ;
157
+ }
160
158
}
161
159
```
162
160
@@ -176,13 +174,12 @@ export interface TooltipDomStyles {
176
174
177
175
默认配置:` 无 `
178
176
179
- ``` js
180
- const config = {
181
- tooltip: {
182
- customContent : (title , data ) => {
183
- return ` <div>${ title} </div>`
184
- };
185
- }
186
- }
187
-
177
+ ``` ts
178
+ {
179
+ tooltip : {
180
+ customContent : (title , data ) => {
181
+ return ` <div>${title }</div> ` ;
182
+ };
183
+ }
184
+ }
188
185
```
You can’t perform that action at this time.
0 commit comments