echarts The X-axis or Y-axis cannot be hidden to limit width overflow

z3yyvxxp  于 5个月前  发布在  Echarts
关注(0)|答案(1)|浏览(45)

Version

v5.4.3

https://echarts.apache.org/examples/zh/editor.html?code=PYBwLglsB2AEC8sDeAoWsDGwA2wBOAXLANoBEAxAMyUCcAHACIBCpAugDRqxjA6QhFU6dGDwQA5uICmhWKQCGADwgBnUp2GwlqgArAI0MDMFdNYAJ4gpRUioAW8gCbAA7qVOwAvl08bY4sUdBXy5FAEFlFSJiIWELKxsMeSNxfHN1D0dk-WjSAFkYdTkAFQBXKSLSAHUpR0riu1LKgDExSoBlZI7S6DYfDi5zCNVo2JFLazkAN3lscozNaHkAWyliqUUwdotsSbHhYCmZADNcFxtRHqSjBc1YFwhHMDsiAEYABg8QxZXJ0kAc1UAUf6AwBwcoAHB0AVJqAH6d3OhPAN0CoZBApFESPslqsbIAXt0ApcaAfujAHept3GCTkACN5HgSbBKXgqo9njYAGzvACkNKyYByJA-7FgAFYAEz8oXvd786gAFklNAlsGo8qFYtY_RQniAA&_source=echarts-doc-preview

Steps to Reproduce

option = {
color: ['#3398DB'],
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
grid: {},
xAxis: [
{
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
}
],
yAxis: [
{
show: true,
type: 'value',
nameLocation: 'end',
nameTextStyle: {
padding: [9, 9, 9, 9],
width: 16,
overflow: 'breakAll',
ellipsis: '***'
},
name: 'Pleasant Goat and Big Big Wolf'
}
],
series: [
{
name: '直接访问',
type: 'bar',
barWidth: '60%',
data: [10, 52, 200, 334, 390, 330, 220]
}
]
};

Current Behavior

Overflowable hide

Expected Behavior

Overflowable hide

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

41zrol4v

41zrol4v1#

duplicate of #17397 , #16940 , #15429 , #14911
undocumented option nameTruncate works. Thanks to @Jagan-P and @asctrl for discovering it.
Usage is: nameTruncate: { maxWidth: 60 }

Please close issue if problem solved.

相关问题