Skip to content

[Bug] tooltip.style.titleLabel中的autoWidth和multiLine设置无效 #3880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Arinod opened this issue Apr 7, 2025 · 0 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@Arinod
Copy link

Arinod commented Apr 7, 2025

Version

1.13.7

Link to Minimal Reproduction

https://www.visactor.io/vchart/demo/storytelling/appear-animation-config

Steps to Reproduce

官方例子加入tooltip的titleLabel限制即可,可复制以下spec
const spec = {
type: 'line',
data: {
values: [
{ type: 'Nail polish Nail polish Nail polish', country: 'Africa', value: 4229 },
{ type: 'Nail polish Nail polish Nail polish', country: 'EU', value: 4376 },
{ type: 'Nail polish Nail polish Nail polish', country: 'China', value: 3054 },
{ type: 'Nail polish Nail polish Nail polish', country: 'USA', value: 12814 },
{ type: 'Eyebrow pencil', country: 'Africa', value: 3932 },
{ type: 'Eyebrow pencil', country: 'EU', value: 3987 },
{ type: 'Eyebrow pencil', country: 'China', value: 5067 },
{ type: 'Eyebrow pencil', country: 'USA', value: 13012 }
]
},
percent: true,
xField: 'type',
yField: 'value',
seriesField: 'country',
tooltip:{
style:{
titleLabel:{
autoWidth:true,
multiLine:true
}
}
},
axes: [
{
orient: 'left',
label: {
formatMethod(val) {
return ${(val * 100).toFixed(2)}%;
}
}
}
]
};

Current Behavior

title不会自动换行,当设置maxWidth时会换行,但是无法知道content区域本来的宽度(即shape+keyLabel+valueLabel的总长度)

Expected Behavior

autoWidth时自动根据内容区域长度进行标题换行处理

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@Arinod Arinod added the bug Something isn't working label Apr 7, 2025
@xile611 xile611 self-assigned this Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants