Skip to content

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

@Arinod

Description

@Arinod

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions