Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
liihuu committed May 26, 2023
1 parent b48196a commit 1cb84e3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 30 deletions.
28 changes: 14 additions & 14 deletions docs/en-US/guide/figure.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ new Figure(attrs, styles).draw(ctx)
These figures are built into the chart, `arc`, `circle`, `line`, `polygon`, `rect`, `text`, `rectText`.
### arc
```typescript
new (
new ({
attrs: {
// The x-axis coordinate value of the center of the circle
x: number
Expand All @@ -44,12 +44,12 @@ new (
// dotted line parameter
dashedValue?: number[]
}
) => Figure
}) => Figure
```

### circle
```typescript
new (
new ({
attrs: {
// The x-axis coordinate value of the center of the circle
x: number
Expand All @@ -72,12 +72,12 @@ new (
// border dotted line parameters
borderDashedValue?: number[]
}
) => Figure
}) => Figure
```

### line
```typescript
new (
new ({
attrs: {
// set of coordinates
coordinates: Array<{
Expand All @@ -95,12 +95,12 @@ new (
// dotted line parameter
dashedValue?: number[]
}
) => Figure
}) => Figure
```

###polygon
```typescript
new (
new ({
attrs: {
// set of coordinates
coordinates: Array<{
Expand All @@ -122,12 +122,12 @@ new (
// border dotted line parameter
borderDashedValue?: number[]
}
) => Figure
}) => Figure
```

### rect
```typescript
new (
new ({
attrs: {
// The x-axis coordinate value of the starting point
x: number
Expand All @@ -154,12 +154,12 @@ new (
// Border fillet value
borderRadius?: number
}
) => Figure
}) => Figure
```

### text
```typescript
new (
new ({
attrs: {
// The x-axis coordinate value of the starting point
x: number
Expand All @@ -182,12 +182,12 @@ new (
// thickness
weight?: string | number
}
) => Figure
}) => Figure
```

### rectText
```typescript
new (
new ({
attrs: {
// The x-axis coordinate value of the starting point
x: number
Expand Down Expand Up @@ -232,7 +232,7 @@ new (
// background color
backgroundColor?: string | CanvasGradient
}
) => Figure
}) => Figure
```

## Customize figure
Expand Down
1 change: 0 additions & 1 deletion docs/guide/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
+ 🆕 `xAxis`新增方法`convertTimestampFromPixel``convertTimestampToPixel`
+ 💄 优化蜡烛柱显示。


## 9.3.0
`2023-05-13`
+ 🆕 新增图表API `utils.calcTextWidth`
Expand Down
30 changes: 15 additions & 15 deletions docs/guide/figure.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ const Figure = klinecharts.getFigureClass(name)
// attrs 属性
// styles 样式
// ctx 画布上下文
new Figure(attrs, styles).draw(ctx)
new Figure({ attrs, styles }).draw(ctx)
```

## 内置基础图形
图表内置了这些基础图形,`arc``circle``line``polygon``rect``text``rectText`
### arc
```typescript
new (
new ({
attrs: {
// 圆心x轴坐标值
x: number
Expand All @@ -44,12 +44,12 @@ new (
// 虚线参数
dashedValue?: number[]
}
) => Figure
}) => Figure
```

### circle
```typescript
new (
new ({
attrs: {
// 圆心x轴坐标值
x: number
Expand All @@ -72,12 +72,12 @@ new (
// 边框虚线参数
borderDashedValue?: number[]
}
) => Figure
}) => Figure
```

### line
```typescript
new (
new ({
attrs: {
// 坐标集合
coordinates: Array<{
Expand All @@ -95,12 +95,12 @@ new (
// 虚线参数
dashedValue?: number[]
}
) => Figure
}) => Figure
```

### polygon
```typescript
new (
new ({
attrs: {
// 坐标集合
coordinates: Array<{
Expand All @@ -122,12 +122,12 @@ new (
// 边框虚线参数
borderDashedValue?: number[]
}
) => Figure
}) => Figure
```

### rect
```typescript
new (
new ({
attrs: {
// 起始点x轴坐标值
x: number
Expand All @@ -154,12 +154,12 @@ new (
// 边框圆角值
borderRadius?: number
}
) => Figure
}) => Figure
```

### text
```typescript
new (
new ({
attrs: {
// 起始点x轴坐标值
x: number
Expand All @@ -182,12 +182,12 @@ new (
// 粗细
weight?: string | number
}
) => Figure
}) => Figure
```

### rectText
```typescript
new (
new ({
attrs: {
// 起始点x轴坐标值
x: number
Expand Down Expand Up @@ -232,7 +232,7 @@ new (
// 背景色
backgroundColor?: string | CanvasGradient
}
) => Figure
}) => Figure
```

## 自定义基础图形
Expand Down

0 comments on commit 1cb84e3

Please sign in to comment.