Skip to content

Commit a26dc3d

Browse files
lxfu1liufu.lf
and
liufu.lf
authored
docs: 添加图表通用配置 (#1439)
Co-authored-by: liufu.lf <[email protected]>
1 parent 2ec5c14 commit a26dc3d

File tree

5 files changed

+166
-150
lines changed

5 files changed

+166
-150
lines changed

docs/common/chart-options.en.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#### width
2+
3+
<description>**可选** _number_</description>
4+
5+
功能描述:设置图表宽度。
6+
7+
默认配置:`400`
8+
9+
#### height
10+
11+
<description>**可选** _number_</description>
12+
13+
功能描述:设置图表高度。
14+
15+
默认配置:`400`
16+
17+
#### autoFit
18+
19+
<description>**可选** _boolean_</description>
20+
21+
功能描述:图表是否自适应容器宽高。当 `autoFit` 设置为 true 时,`width``height` 的设置将失效。
22+
23+
默认配置:`true`
24+
25+
#### padding
26+
27+
<description>**可选** _number[] | number | 'auto'_</description>
28+
29+
功能描述: 画布的 `padding` 值,或者开启 `auto`
30+
31+
#### appendPadding
32+
33+
<description>**可选** _number[] | number_</description>
34+
35+
功能描述: 额外增加的 `appendPadding` 值。
36+
37+
#### renderer
38+
39+
<description>**可选** _string_</description>
40+
41+
功能描述: 设置图表渲染方式为 `canvas``svg`
42+
43+
默认配置: `canvas`
44+
45+
#### pixelRatio
46+
47+
<description>**可选** _number_</description>
48+
49+
功能描述: 设置图表渲染的像素比。
50+
51+
默认配置: `window.devicePixelRatio`

docs/common/chart-options.zh.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<tag color="#87d068" text="我是引用"></tag>
2+
3+
#### width
4+
5+
<description>**可选** _number_</description>
6+
7+
功能描述:设置图表宽度。
8+
9+
默认配置:`400`
10+
11+
#### height
12+
13+
<description>**可选** _number_</description>
14+
15+
功能描述:设置图表高度。
16+
17+
默认配置:`400`
18+
19+
#### autoFit
20+
21+
<description>**可选** _boolean_</description>
22+
23+
功能描述:图表是否自适应容器宽高。当 `autoFit` 设置为 true 时,`width``height` 的设置将失效。
24+
25+
默认配置:`true`
26+
27+
#### padding
28+
29+
<description>**可选** _number[] | number | 'auto'_</description>
30+
31+
功能描述: 画布的 `padding` 值,或者开启 `auto`
32+
33+
#### appendPadding
34+
35+
<description>**可选** _number[] | number_</description>
36+
37+
功能描述: 额外增加的 `appendPadding` 值。
38+
39+
#### renderer
40+
41+
<description>**可选** _string_</description>
42+
43+
功能描述: 设置图表渲染方式为 `canvas``svg`
44+
45+
默认配置: `canvas`
46+
47+
#### pixelRatio
48+
49+
<description>**可选** _number_</description>
50+
51+
功能描述: 设置图表渲染的像素比。
52+
53+
默认配置: `window.devicePixelRatio`

examples/scatter/basic/API.en.md

+34-77
Original file line numberDiff line numberDiff line change
@@ -2,65 +2,15 @@
22
title: API
33
---
44

5-
# 配置属性
5+
## 配置属性
66

7-
## 图表容器
7+
### 图表容器
88

9-
### width
9+
`markdown:common/chart-options.en.md`
1010

11-
**可选**, _number_
11+
### 数据映射
1212

13-
功能描述: 设置图表宽度。
14-
15-
默认配置: `400`
16-
17-
### height
18-
19-
**可选**, _number_
20-
21-
功能描述: 设置图表高度。
22-
23-
默认配置: `400`
24-
25-
### autoFit
26-
27-
**可选**, _boolean_
28-
29-
功能描述: 画布是否自动适配容器大小,当 `autoFit` 设置为 true 时,`width``height` 的设置将失效。
30-
31-
默认配置: `true`
32-
33-
### padding
34-
35-
**可选**, number[] | number | 'auto'
36-
37-
功能描述: 画布的 `padding` 值,或者开启 `auto`
38-
39-
### appendPadding
40-
41-
**可选**, number[] | number
42-
43-
功能描述: 额外怎加的 `appendPadding`
44-
45-
### renderer
46-
47-
**可选**, _string_
48-
49-
功能描述: 设置图表渲染方式为 `canvas``svg`
50-
51-
默认配置: `canvas`
52-
53-
### pixelRatio
54-
55-
**可选**, number
56-
57-
功能描述: 设置图表渲染的像素比
58-
59-
默认配置: `window.devicePixelRatio`
60-
61-
## 数据映射
62-
63-
### data 📌
13+
#### data 📌
6414

6515
**必选**, _array object_
6616

@@ -70,7 +20,7 @@ title: API
7020

7121
数据源为对象集合,例如:`[{ time: '1991',value: 20 }, { time: '1992',value: 20 }]`
7222

73-
### meta
23+
#### meta
7424

7525
**可选**, _object_
7626

@@ -115,39 +65,39 @@ scatterPlot.render();
11565

11666
```
11767

118-
### xField 📌
68+
#### xField 📌
11969

12070
**必选**, _string_
12171

12272
功能描述: 点形状在 x 方向位置映射对应的数据字段名,一般对应一个连续字段。
12373

12474
默认配置: 无
12575

126-
### yField 📌
76+
#### yField 📌
12777

12878
**必选**, _string_
12979

13080
功能描述: 点形状在 y 方向位置映射所对应的数据字段名,一般对应一个连续字段。
13181

13282
默认配置: 无
13383

134-
### type
84+
#### type
13585

136-
**可选**, `jitter` | `stack` | `symmetric` | `dodge`;
86+
**可选**, _jitter | stack | symmetric | dodge_;
13787

13888
功能描述: 数据调整类型,不建议修改。
13989

14090
默认配置: `jitter`
14191

142-
### colorField
92+
#### colorField
14393

14494
**可选**, _string_
14595

14696
功能描述: 点颜色映射对应的数据字段名。
14797

148-
## 图形样式
98+
### 图形样式
14999

150-
### color
100+
#### color
151101

152102
**可选**, _string | string[] | Function_
153103

@@ -174,16 +124,17 @@ color: (type) => {
174124
},
175125
```
176126

177-
### sizeField
127+
#### sizeField
178128

179129
**可选**, _string_
180130

181131
功能描述: 点大小映射对应的数据字段名。
182132

183-
### size ✨
133+
#### size ✨
184134

185-
_
186-
**可选**, \_number | [number, number] | Function_
135+
[**DEMO1**](../../scatter/basic#color-mapping)
136+
137+
**可选**, \_number | [number, number] | Function\_
187138

188139
功能描述: 指定点的大小。如没有配置 sizeField,指定一个即可。对 sizeFiled 进行了配置的情况下,可以指定大小数组 `[minSize, maxSize]`, 也可以通过回调函数的方法根据对应数值进行设置。
189140

@@ -201,16 +152,17 @@ size: (weight) => {
201152
},
202153
```
203154

204-
### shapeField
155+
#### shapeField
205156

206157
**可选**, _string_
207158

208159
功能描述: 点形状映射对应的数据字段名。
209160

210-
### shape ✨
161+
#### shape ✨
162+
163+
[**DEMO2**](../../scatter/basic#shape-mapping)
211164

212-
_
213-
**可选**, \_string | string[] | Function_
165+
**可选**, \_string | string[] | Function\_
214166

215167
功能描述: 指定点的形状。如没有配置 shapeField ,指定一个即可。对 shapeField 进行了配置的情况下,可以指定形状数组 `['cicle', 'square']`, 也可以通过回调函数的方法根据对应数值进行设置。
216168

@@ -233,7 +185,7 @@ shape: (gender) => {
233185
},
234186
```
235187

236-
### pointStyle ✨
188+
#### pointStyle ✨
237189

238190
**可选**, _object_
239191

@@ -278,15 +230,20 @@ pointStyle: (x, y, colorField) => {
278230
};
279231
```
280232

281-
## 图表组件
233+
### 图表组件
282234

283-
`xAxis``yAxis``legend``tooltip``label``theme` 等通用组件请参考图表通用配置
235+
`markdown:common/tooltip.en.md`
236+
`markdown:common/xAxis.en.md`
237+
`markdown:common/yAxis.en.md`
238+
`markdown:common/xAxis.en.md`
239+
`markdown:common/legend.en.md`
240+
`markdown:common/theme.en.md`
284241

285-
## 事件
242+
### 事件
286243

287-
[通用 events](../../general/events/API)
244+
`markdown:common/events.en.md`
288245

289-
### 点图形事件
246+
#### 点图形事件
290247

291248
| onPointClick<br />点点击事件 | onPointDblClick<br />点双击事件 | onPointDblClick<br />点双击事件 | onPointMouseleave<br />点鼠标离开事件 |
292249
| ------------------------------------ | ----------------------------------- | ---------------------------------- | ------------------------------------- |

0 commit comments

Comments
 (0)