Skip to content

Commit c27865c

Browse files
author
xuying.xu
committed
chore: 调整官网文档
1 parent 1a9cc6a commit c27865c

File tree

17 files changed

+194
-172
lines changed

17 files changed

+194
-172
lines changed

site/.dumirc.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ export default defineConfig({
7474
},
7575
order: 4,
7676
},
77+
{
78+
slug: 'api/chart/guide',
79+
title: {
80+
zh: '标注 - Guide',
81+
en: 'Guide',
82+
},
83+
order: 10,
84+
},
7785
{
7886
slug: 'tutorial/framework',
7987
title: {

site/docs/api/chart/guide.zh.md

Lines changed: 0 additions & 172 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: 标注 - Guide
3+
order: 9
4+
---
5+
6+
提示和标注,主要用于在图表上标识额外的标记注解。目前内置 PointGuide 点标注、TextGuide 文本标注、TagGuide 标注、ImageGuide 图片标注和 LineGuide 线标注,也可以自定义标注。
7+
8+
- [点标注 PointGuide](./point-guide.zh.md)
9+
- [文本标注 TextGuide](./text-guide.zh.md)
10+
- [标签标注 TagGuide](./tag-guide.zh.md)
11+
- [图片标注 ImageGuide](./image-guide.zh.md)
12+
- [辅助线标注 LineGuide](./line-guide.zh.md)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: 图片标注 - ImageGuide
3+
---
4+
5+
## 用法
6+
7+
```jsx
8+
import { ImageGuide } from '@antv/f2';
9+
10+
<ImageGuide
11+
records={[{ genre: 'Sports', sold: 5 }]}
12+
src="https://example.com/image.png"
13+
attrs={{ width: 24, height: 24 }}
14+
offsetX={0}
15+
offsetY={0}
16+
/>
17+
```
18+
19+
## Props
20+
21+
- **records: Array**
22+
标注的数据项或比例值
23+
- **src: string**
24+
图片地址
25+
- **attrs**
26+
图片属性
27+
- **offsetX: number**
28+
x 轴偏移量
29+
- **offsetY: number**
30+
y 轴偏移量
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: 辅助线标注 - LineGuide
3+
---
4+
5+
## 用法
6+
7+
```jsx
8+
import { LineGuide } from '@antv/f2';
9+
10+
<LineGuide
11+
records={[{ genre: 'min', sold: 'max' }]}
12+
style={{ stroke: '#f00', lineWidth: 2 }}
13+
offsetX={0}
14+
offsetY={0}
15+
/>
16+
```
17+
18+
## Props
19+
20+
- **records: Array**
21+
标注的数据项或比例值
22+
- **offsetX: number**
23+
x 轴偏移量
24+
- **offsetY: number**
25+
y 轴偏移量
26+
- **style**
27+
线样式
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: 点标注 - PointGuide
3+
---
4+
5+
## 用法
6+
7+
```jsx
8+
import { PointGuide } from '@antv/f2';
9+
10+
<PointGuide records={[{ genre: 'Sports', sold: 5 }]} offsetX={10} offsetY={-10} style={{ fill: '#f00' }} />
11+
```
12+
13+
## Props
14+
15+
- **records: Array**
16+
标注的数据项或比例值
17+
- **offsetX: number**
18+
x 轴偏移量
19+
- **offsetY: number**
20+
y 轴偏移量
21+
- **style**
22+
标注样式
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: 标签标注 - TagGuide
3+
---
4+
5+
## 用法
6+
7+
```jsx
8+
import { TagGuide } from '@antv/f2';
9+
10+
<TagGuide
11+
records={[{ genre: 'Sports', sold: 5 }]}
12+
content="标签内容"
13+
direct="tr"
14+
background={{ fill: '#fff' }}
15+
textStyle={{ fill: '#000' }}
16+
/>
17+
```
18+
19+
## Props
20+
21+
- **records: Array**
22+
标注的数据项或比例值
23+
- **content: string**
24+
文本内容
25+
- **offsetX: number**
26+
x 轴偏移量
27+
- **offsetY: number**
28+
y 轴偏移量
29+
- **direct: string**
30+
可选值:'tl' | 'tc' | 'tr' | 'cl' | 'cr' | 'bl' | 'bc' | 'br'
31+
- **background: Attrs**
32+
背景样式
33+
- **triggerRef: any**
34+
tagGuide 实例
35+
- **textStyle: TextAttr**
36+
文本样式
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: 文本标注 - TextGuide
3+
---
4+
5+
## 用法
6+
7+
```jsx
8+
import { TextGuide } from '@antv/f2';
9+
10+
<TextGuide
11+
records={[{ genre: 'Sports', sold: 5 }]}
12+
content="文本内容"
13+
offsetX={-15}
14+
offsetY={-20}
15+
style={{ fill: '#000', fontSize: '24px' }}
16+
/>
17+
```
18+
19+
## Props
20+
21+
- **records: Array**
22+
标注的数据项或比例值
23+
- **content: string**
24+
文本内容
25+
- **offsetX: number**
26+
x 轴偏移量
27+
- **offsetY: number**
28+
y 轴偏移量
29+
- **style**
30+
文本样式

site/examples/area/area/index.zh.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ title: 基础面积图
33
order: 0
44
---
55

6+
- [基础面积图](./demo/area.jsx)
7+
- [带负值面积图](./demo/with-negative.jsx)
8+
- [带负值面积图(x 基线不为 0)](./demo/with-negative-not-start-on-zero.jsx)
9+
- [渐变填充面积图](./demo/gradient.jsx)

site/examples/area/stacked/index.zh.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ title: 层叠面积图
33
order: 1
44
---
55

6+
- [百分比分组柱图](./demo/percent.jsx)
7+
- [区域图(存在空值)](./demo/area-none.jsx)
8+
- [层叠面积图](./demo/stacked.jsx)

0 commit comments

Comments
 (0)