Skip to content

Commit

Permalink
fix: funnel outer label support react/html element, fix #3462
Browse files Browse the repository at this point in the history
  • Loading branch information
xile611 committed Nov 25, 2024
1 parent 276dc34 commit fcdcef4
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/assets/option/en/graphic/rich-text/rich-text.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,11 @@ Fill Opacity. The configuration in all text paragraphs will be overridden by the
#${prefix} strokeOpacity(number)

Stroke opacity. The configuration in all text paragraphs will be overridden by the configuration in `textConfig`.

#${prefix} forceBoundsWidth(number)

Forcibly set the width of the bounding box corresponding to the text. By default, we automatically calculate the width based on the content and attributes of the text. When this property is set, the width of the bounding box will be forcibly set to this value. It is generally used when rendering text content with HTML or React to solve the problem of width not being automatically calculated.

#${prefix} forceBoundsHeight(number)

Forcibly set the height of the bounding box corresponding to the text. By default, we automatically calculate the height based on the content and attributes of the text. When this property is set, the height of the bounding box will be forcibly set to this value. It is generally used when rendering text content with HTML or React to solve the problem of height not being automatically calculated.
8 changes: 8 additions & 0 deletions docs/assets/option/en/graphic/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ Options:
- "break-word": Does not allow breaking words in CJK (Chinese/Japanese/Korean) text, only breaks at half-width spaces or hyphens.
- "keep-all": Does not break words in CJK (Chinese/Japanese/Korean) text. Non-CJK text words are not broken. (Supported since version 1.12.8)

#${prefix} forceBoundsWidth(number)

Forcibly set the width of the bounding box corresponding to the text. By default, we automatically calculate the width based on the content and attributes of the text. When this property is set, the width of the bounding box will be forcibly set to this value. It is generally used when rendering text content with HTML or React to solve the problem of width not being automatically calculated.

#${prefix} forceBoundsHeight(number)

Forcibly set the height of the bounding box corresponding to the text. By default, we automatically calculate the height based on the content and attributes of the text. When this property is set, the height of the bounding box will be forcibly set to this value. It is generally used when rendering text content with HTML or React to solve the problem of height not being automatically calculated.

#${prefix} keepDirIn3d(boolean)

Whether to always maintain the direction facing the window in 3d mode (if set to false, it will rotate with the viewpoint, if set to true, the direction will always face the window)
Expand Down
10 changes: 10 additions & 0 deletions docs/assets/option/zh/graphic/rich-text/rich-text.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,13 @@
#${prefix} strokeOpacity(number)

描边透明度。配置于所有文字段落的,会被 `textConfig` 中的配置覆盖。

#${prefx} forceBoundsWidth(number)

强制设置文本对应的包围盒宽度,默认我们会根据文本的内容和属性,自动计算宽度,当设置了该属性之后,包围盒的宽度会被强制设置为该值。
一般用于使用 html 或者 react 渲染文本内容的时候,解决宽度没法自动计算的情况。

#${prefx} forceBoundsHeight(number)

强制设置文本对应的包围盒高度,默认我们会根据文本的内容和属性,自动计算高度,当设置了该属性之后,包围盒的高度会被强制设置为该值。
一般用于使用 html 或者 react 渲染文本内容的时候,解决宽度没法自动计算的情况。
10 changes: 10 additions & 0 deletions docs/assets/option/zh/graphic/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@
- "break-word": 不允许 CJK(中文/日文/韩文)文本中的单词换行,只能在半角空格或连字符处换行。
- "keep-all": CJK(中文/日文/韩文)文本不断行。非 CJK 文本单词不断行。(从 1.12.8 版本开始支持)

#${prefx} forceBoundsWidth(number)

强制设置文本对应的包围盒宽度,默认我们会根据文本的内容和属性,自动计算宽度,当设置了该属性之后,包围盒的宽度会被强制设置为该值。
一般用于使用 html 或者 react 渲染文本内容的时候,解决宽度没法自动计算的情况。

#${prefx} forceBoundsHeight(number)

强制设置文本对应的包围盒高度,默认我们会根据文本的内容和属性,自动计算高度,当设置了该属性之后,包围盒的高度会被强制设置为该值。
一般用于使用 html 或者 react 渲染文本内容的时候,解决宽度没法自动计算的情况。

#${prefix} keepDirIn3d(boolean)

是否在 3d 模式中始终保持方向朝向窗口(配置为 false 则会随着视角旋转而旋转,配置为 true,那么方向始终朝向窗口)
Expand Down
1 change: 1 addition & 0 deletions packages/vchart/src/series/funnel/funnel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ export class FunnelSeries<T extends IFunnelSeriesSpec = IFunnelSeriesSpec>
this.setMarkStyle(
outerLabelMark,
{
_originText: (datum: Datum) => `${datum[this.getCategoryField()]}`,
text: (datum: Datum) => {
return this._spec.outerLabel.formatMethod(`${datum[this.getCategoryField()]}`, datum) as any;
}
Expand Down

0 comments on commit fcdcef4

Please sign in to comment.