Skip to content

Commit

Permalink
docs: update docs of layoutRadius in pie
Browse files Browse the repository at this point in the history
  • Loading branch information
xile611 committed Aug 9, 2024
1 parent 846484b commit 814f836
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 13 deletions.
22 changes: 16 additions & 6 deletions docs/assets/option/en/series/pie.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,25 @@ pie: {
}
```

#${prefix} layoutRadius(string|number|function)

Introduced in version **1.11.12**

The layout radius of the polar coordinate, which is the base value for calculating the inner and outer radii. The optional values are as follows:

- Not set: The default value is `Math.min(width, height) / 2`, which is equivalent to this effect before version **1.11.2**
- `'auto'`: Automatically calculate the maximum available layout radius based on `center`, `startAngle`, and `endAngle`
- Custom function, the type definition of the function is as follows:

```ts
(layoutRect: { width: number; height: number }, center: { x: number; y: number }) => number;
```

#${prefix} outerRadius(number)

Pie chart outer sector radius. The default value is 0.6.

#${prefix} outerRadius(number)
#${prefix} innerRadius(number)

Pie chart inner sector radius. The default value is 0.

Expand Down Expand Up @@ -191,11 +205,7 @@ The callback function is defined as follows:
* @params path object, user-defined drawing
* @return Returns the path after drawing is completed
*/
(
text: ITextGraphicAttribute,
attrs: Partial<ILineGraphicAttribute>,
path: ICustomPath2D
) => ICustomPath2D;
(text: ITextGraphicAttribute, attrs: Partial<ILineGraphicAttribute>, path: ICustomPath2D) => ICustomPath2D;
```

###${prefix} style(Object)
Expand Down
24 changes: 17 additions & 7 deletions docs/assets/option/zh/series/pie.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,25 @@ pie: {
}
```

#${prefix} layoutRadius(string|number|function)

**1.11.12**版本开始支持

极坐标的布局半径,即计算内径、外径的基准值,可选值如下:

- 不设置: 默认值为`Math.min(width, height) / 2`**1.11.2**之前的版本相当于这个效果
- `'auto'`: 根据`center``startAngle``endAngle`自动计算最大可用的布局半径
- 自定义函数,函数的类型定义如下:

```ts
(layoutRect: { width: number; height: number }, center: { x: number; y: number }) => number;
```

#${prefix} outerRadius(number)

饼图扇区外半径。默认值为 0.6。

#${prefix} outerRadius(number)
#${prefix} innerRadius(number)

饼图扇区内半径。默认值为 0。

Expand Down Expand Up @@ -181,7 +195,7 @@ pie: {
) }}

##${prefix} customShape(function)
自1.11.11版本, 标签引导线支持自定义path.
自 1.11.11 版本, 标签引导线支持自定义 path.

回调函数的定义如下:

Expand All @@ -192,11 +206,7 @@ pie: {
* @params path对象, 用户自定义绘制
* @return 返回绘制完成后的path
*/
(
text: ITextGraphicAttribute,
attrs: Partial<ILineGraphicAttribute>,
path: ICustomPath2D
) => ICustomPath2D;
(text: ITextGraphicAttribute, attrs: Partial<ILineGraphicAttribute>, path: ICustomPath2D) => ICustomPath2D;
```

###${prefix} style(Object)
Expand Down

0 comments on commit 814f836

Please sign in to comment.