Skip to content

Commit 56db3df

Browse files
committed
docs: update docs
1 parent 96820e8 commit 56db3df

File tree

8 files changed

+97
-6
lines changed

8 files changed

+97
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
!.editorconfig
99
!.storybook
1010
!.demoProjectTemplate
11+
!site/.eslintrc.js
1112

1213
site/public/
1314
lerna-debug.json
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: config
3+
zhName: 通用配置场景
4+
---
5+
6+
# 通用配置场景
7+
8+
## Props
9+
10+
### width/height
11+
通过`width/height`这两个属性可以配置图表组件的宽度和高度,不配置时则默认为父组件的宽度/高度。
12+
注意,这两个属性是直接通过`props`向组件传递的,不需要放在`config`中。
13+
14+
[MDXInstruction:importDemo:WidthHeight](./demo/WidthHeight.tsx)
15+
16+
---
17+
18+
以下所有配置都是`config`中的参数。
19+
20+
## Padding
21+
可以通过配置`config.padding`来控制图表的内边距。padding的值类似与css里的padding,详细的请看这里[属性-padding](/guides/props#padding)
22+
23+
### 设置Padding大小
24+
25+
[MDXInstruction:importDemo:PaddingBasic](./demo/PaddingBasic.tsx)
26+
27+
## Legend
28+
可以通过配置`config.legend`来控制图表里的图例,详细的请看这里[配置-图例](/guides/config-legend)
29+
30+
### Legend位置
31+
32+
[MDXInstruction:importDemo:LegendPosition](../console-pie-chart/demo/Legend.tsx)
33+
34+
### Legend在右边
35+
通过设置Chart的`右Padding`和Legend的`offsetY`属性来控制legend的位置。
36+
37+
Note: `右Padding`是指圆形的右边界到渲染区域的右边界。`offsetY`是指圆形的右边界到legend的左边界。
38+
39+
[MDXInstruction:importDemo:LegendRight](../console-pie-chart/demo/LegendRight.tsx)
40+
41+
### Legend tip
42+
43+
配置`legend``tip`属性可开启legend悬浮提示。开启tip配置之后,可进一步配置`tipFormatter`属性来进行格式化tip显示内容(取值优先级:`tipFormatter` => `itemFormatter` => `value`
44+
45+
Note: `legend``tip`属性是通过`dom``title`属性来进行简单实现的,只能满足简单场景。
46+
47+
[MDXInstruction:importDemo:LegendTip](../console-pie-chart/demo/LegendTip.tsx)
48+
49+
## Tooltip
50+
可以通过配置`config.tooltip`来控制图表里的图例,详细的请看这里[配置-提示信息](/guides/config-tooltip)
51+
52+
## 自定义tooltip
53+
54+
[MDXInstruction:importDemo:Tooltip](../console-pie-chart/demo/Tooltip.tsx)
55+
56+
## 复杂Tooltip
57+
58+
[MDXInstruction:importDemo:ComplexTooltip](../console-pie-chart/demo/ComplexTooltip.tsx)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import React from 'react';
2+
import { ConsoleBarChart } from '@alicloud/console-chart';
3+
4+
const data = [
5+
{
6+
name: '阿里云Nat网关价格/月',
7+
data: [
8+
['Small', 306], ['Middle', 586.5], ['Large', 1147.5], ['XLarge.1', 2040]
9+
],
10+
},
11+
];
12+
13+
const config = {
14+
padding: [50, 50, 100, 100],
15+
}
16+
17+
export default () => (
18+
<ConsoleBarChart data={data} height={300} config={config} />
19+
);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from 'react';
2+
import { ConsoleMinilineChart } from '@alicloud/console-chart';
3+
4+
const data = [
5+
{
6+
name: 'A产品',
7+
data: [['2015', 20], ['2016', 5], ['2017', 15], ['2018', 30], ['2019', 40]],
8+
},
9+
];
10+
11+
export default () => (
12+
<ConsoleMinilineChart data={data} height={300} width={200} />
13+
);

packages/console-sankey-chart/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ zhName: 桑基图
55

66
# 桑基图API
77

8-
桑基图是关系图的一种,常用来表示流入流出的关系。
8+
桑基图是关系图的一种,常用来表示流入流出的关系。
99

1010
典型桑基图的特点有:
1111

packages/console-tree-graph/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
---
2-
name: console-tree-graph
3-
zhName: 基本树图
4-
---
51

62
# 树图API
73

site/.eslintrc.js

Whitespace-only changes.

site/gatsby-config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,14 @@ module.exports = {
7575
topNav: [
7676
{ text: "指南", href: "/guides/quick-start" },
7777
{ text: "组件文档", href: "/components/console-bar-chart" },
78+
{
79+
text: '国内镜像',
80+
href: 'http://seekhowqiuhao.gitee.io/alibabacloud-console-chart/components/console-bar-chart',
81+
},
7882
{
7983
text: 'Github',
8084
href: 'https://github.com/aliyun/alibabacloud-console-chart',
81-
},
85+
}
8286
],
8387
// 左侧导航
8488
// 左侧导航与顶部导航的区别:

0 commit comments

Comments
 (0)