Skip to content

Commit fcdcef4

Browse files
committed
fix: funnel outer label support react/html element, fix #3462
1 parent 276dc34 commit fcdcef4

File tree

5 files changed

+37
-0
lines changed

5 files changed

+37
-0
lines changed

docs/assets/option/en/graphic/rich-text/rich-text.md

+8
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,11 @@ Fill Opacity. The configuration in all text paragraphs will be overridden by the
135135
#${prefix} strokeOpacity(number)
136136

137137
Stroke opacity. The configuration in all text paragraphs will be overridden by the configuration in `textConfig`.
138+
139+
#${prefix} forceBoundsWidth(number)
140+
141+
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.
142+
143+
#${prefix} forceBoundsHeight(number)
144+
145+
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.

docs/assets/option/en/graphic/text.md

+8
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ Options:
9191
- "break-word": Does not allow breaking words in CJK (Chinese/Japanese/Korean) text, only breaks at half-width spaces or hyphens.
9292
- "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)
9393

94+
#${prefix} forceBoundsWidth(number)
95+
96+
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.
97+
98+
#${prefix} forceBoundsHeight(number)
99+
100+
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.
101+
94102
#${prefix} keepDirIn3d(boolean)
95103

96104
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)

docs/assets/option/zh/graphic/rich-text/rich-text.md

+10
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,13 @@
143143
#${prefix} strokeOpacity(number)
144144

145145
描边透明度。配置于所有文字段落的,会被 `textConfig` 中的配置覆盖。
146+
147+
#${prefx} forceBoundsWidth(number)
148+
149+
强制设置文本对应的包围盒宽度,默认我们会根据文本的内容和属性,自动计算宽度,当设置了该属性之后,包围盒的宽度会被强制设置为该值。
150+
一般用于使用 html 或者 react 渲染文本内容的时候,解决宽度没法自动计算的情况。
151+
152+
#${prefx} forceBoundsHeight(number)
153+
154+
强制设置文本对应的包围盒高度,默认我们会根据文本的内容和属性,自动计算高度,当设置了该属性之后,包围盒的高度会被强制设置为该值。
155+
一般用于使用 html 或者 react 渲染文本内容的时候,解决宽度没法自动计算的情况。

docs/assets/option/zh/graphic/text.md

+10
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@
9292
- "break-word": 不允许 CJK(中文/日文/韩文)文本中的单词换行,只能在半角空格或连字符处换行。
9393
- "keep-all": CJK(中文/日文/韩文)文本不断行。非 CJK 文本单词不断行。(从 1.12.8 版本开始支持)
9494

95+
#${prefx} forceBoundsWidth(number)
96+
97+
强制设置文本对应的包围盒宽度,默认我们会根据文本的内容和属性,自动计算宽度,当设置了该属性之后,包围盒的宽度会被强制设置为该值。
98+
一般用于使用 html 或者 react 渲染文本内容的时候,解决宽度没法自动计算的情况。
99+
100+
#${prefx} forceBoundsHeight(number)
101+
102+
强制设置文本对应的包围盒高度,默认我们会根据文本的内容和属性,自动计算高度,当设置了该属性之后,包围盒的高度会被强制设置为该值。
103+
一般用于使用 html 或者 react 渲染文本内容的时候,解决宽度没法自动计算的情况。
104+
95105
#${prefix} keepDirIn3d(boolean)
96106

97107
是否在 3d 模式中始终保持方向朝向窗口(配置为 false 则会随着视角旋转而旋转,配置为 true,那么方向始终朝向窗口)

packages/vchart/src/series/funnel/funnel.ts

+1
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ export class FunnelSeries<T extends IFunnelSeriesSpec = IFunnelSeriesSpec>
308308
this.setMarkStyle(
309309
outerLabelMark,
310310
{
311+
_originText: (datum: Datum) => `${datum[this.getCategoryField()]}`,
311312
text: (datum: Datum) => {
312313
return this._spec.outerLabel.formatMethod(`${datum[this.getCategoryField()]}`, datum) as any;
313314
}

0 commit comments

Comments
 (0)