Skip to content

Commit 3a70822

Browse files
authored
docs(funnel): 漏斗图转化率信息组件文档 api 补全 (#2894)
1 parent 379df35 commit 3a70822

File tree

2 files changed

+34
-14
lines changed

2 files changed

+34
-14
lines changed

docs/api/plots/funnel.en.md

+18-8
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ Whether the height is dynamic. When set to `true`, the height of each elemnet in
6262

6363
the max size of graphic,is between 0 and 1, default 1。
6464

65-
Tip: when set dynamicHeight to be true, this field is invalid
65+
Tip: when set dynamicHeight to be true, this field is invalid
6666

6767
#### minSize
6868

6969
<description>**optional** _number_ _default:_ `1`</description>
7070

7171
the min size of graphic,is between 0 and 1, default 0。
7272

73-
Tip: when set dynamicHeight to be true, this field is invalid
73+
Tip: when set dynamicHeight to be true, this field is invalid
7474

7575
#### funnelStyle
7676

@@ -96,7 +96,16 @@ Graphic style of funnel. You can either pass in the 'shapeStyle' structure direc
9696

9797
Configure the conversion rate component.
9898

99-
Defalut: `{offsetX: 10, offsetY: 0, formatter: (datum) => '转化率' + datum.$$percentage$$ * 100 + '%',}`
99+
Defalut: `{offsetX: 10, offsetY: 0, formatter: (datum) => '转化率' + datum[Funnel.PERCENT_FIELD] * 100 + '%',}`
100+
101+
| Properties | Type | Description |
102+
| ---------- | ---------------------------------------------------- | ---------------------- |
103+
| offsetX | _number_ | x 偏移量 |
104+
| offsetY | _number_ | y 偏移量 |
105+
| style | _ShapeAttrs \| false_ | Text style |
106+
| formatter | _string \| ((datum?: Datum, data?: Data) => string)_ | Text content formatter |
107+
108+
Please refer to the style configuration [ShapeAttrs](/en/docs/api/graphic-style)
100109

101110
`markdown:docs/common/color.en.md`
102111

@@ -126,11 +135,11 @@ Funnel plot provides static properties, makes it easy to use.
126135

127136
#### Static variables
128137

129-
| Field | Description |
130-
| --- | --- |
131-
| `CONVERSATION_FIELD` | The corresponding value of this field is an array, stores the current and previous values of the funnel, for example, [263, 151], from which the user can calculate the conversion rate |
132-
| `PERCENT_FIELD` | The corresponding value of this field represents the `conversion percentage` between current value and previous value |
133-
| `TOTAL_PERCENT_FIELD` | The corresponding value of this field represents the percentage of total conversion rate |
138+
| Field | Description |
139+
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
140+
| `CONVERSATION_FIELD` | The corresponding value of this field is an array, stores the current and previous values of the funnel, for example, [263, 151], from which the user can calculate the conversion rate |
141+
| `PERCENT_FIELD` | The corresponding value of this field represents the `conversion percentage` between current value and previous value |
142+
| `TOTAL_PERCENT_FIELD` | The corresponding value of this field represents the percentage of total conversion rate |
134143

135144
**Example:**
136145

@@ -173,4 +182,5 @@ import { FUNNEL_CONVERSATION_FIELD } from '@antv/g2plot';
173182
```
174183

175184
<!-- 直接 三级导航展开 -->
185+
176186
`markdown:docs/common/annotations.zh.md`

docs/api/plots/funnel.zh.md

+16-6
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,16 @@ order: 9
9696

9797
配置转化率组件。
9898

99-
默认配置:`{offsetX: 10, offsetY: 0, formatter: (datum) => '转化率' + datum.$$percentage$$ * 100 + '%',}`
99+
默认配置:`{offsetX: 10, offsetY: 0, formatter: (datum) => '转化率' + datum[Funnel.PERCENT_FIELD] * 100 + '%',}`
100+
101+
| 配置项 | 类型 | 功能描述 |
102+
| --------- | ---------------------------------------------------- | ---------------- |
103+
| offsetX | _number_ | x 偏移量 |
104+
| offsetY | _number_ | y 偏移量 |
105+
| style | _ShapeAttrs \| false_ | 文本字体样式配置 |
106+
| formatter | _string \| ((datum?: Datum, data?: Data) => string)_ | 文本内容格式化 |
107+
108+
样式配置类型请参考 [绘图属性](/zh/docs/api/graphic-style)
100109

101110
`markdown:docs/common/color.zh.md`
102111

@@ -126,11 +135,11 @@ order: 9
126135

127136
#### 静态变量
128137

129-
| 字段 key 值 | 说明 |
130-
| --- | --- |
131-
| `CONVERSATION_FIELD` | 该字段对应数值为数组,存储漏斗当前和上一项值,例如 [263, 151], 用户可由此计算转化率 |
132-
| `PERCENT_FIELD` | 该字段对应数值代表的是当前数值和上一项值的转化率百分比 |
133-
| `TOTAL_PERCENT_FIELD` | 该字段对应数值代表的总转化率百分比 |
138+
| 字段 key 值 | 说明 |
139+
| --------------------- | ----------------------------------------------------------------------------------- |
140+
| `CONVERSATION_FIELD` | 该字段对应数值为数组,存储漏斗当前和上一项值,例如 [263, 151], 用户可由此计算转化率 |
141+
| `PERCENT_FIELD` | 该字段对应数值代表的是当前数值和上一项值的转化率百分比 |
142+
| `TOTAL_PERCENT_FIELD` | 该字段对应数值代表的总转化率百分比 |
134143

135144
**使用示例:**
136145

@@ -174,4 +183,5 @@ import { FUNNEL_CONVERSATION_FIELD } from '@antv/g2plot';
174183
```
175184

176185
<!-- 直接 三级导航展开 -->
186+
177187
`markdown:docs/common/annotations.zh.md`

0 commit comments

Comments
 (0)