MCPcopy
hub / github.com/apache/echarts / getTextRect

Method getTextRect

src/model/mixin/textStyle.ts:67–79  ·  view source on GitHub ↗
(this: Model<LabelRectRelatedOption> & TextStyleMixin, text: string)

Source from the content-addressed store, hash-verified

65 }
66
67 getTextRect(this: Model<LabelRectRelatedOption> & TextStyleMixin, text: string): graphicUtil.BoundingRect {
68 const style: TextStyleProps = {
69 text: text,
70 verticalAlign: this.getShallow('verticalAlign')
71 || this.getShallow('baseline')
72 };
73 for (let i = 0; i < textStyleParams.length; i++) {
74 (style as any)[textStyleParams[i]] = this.getShallow(textStyleParams[i]);
75 }
76 tmpText.useStyle(style);
77 tmpText.update();
78 return tmpText.getBoundingRect();
79 }
80};
81
82export default TextStyleMixin;

Callers 3

_prepareMethod · 0.80
_renderBarMethod · 0.80
estimateLabelUnionRectFunction · 0.80

Calls 3

getShallowMethod · 0.80
updateMethod · 0.65
getBoundingRectMethod · 0.45

Tested by

no test coverage detected