关于 echarts X轴坐标名称过长显示问题

xAxis: { //x轴参数配置
type: 'category',
data: [],
axisTick: {
alignWithLabel: true,
},
axisLine: {
lineStyle: {
color: '#9c9c9c',
},
},
axisLabel: {
// 坐标轴刻度标签的相关设置。
show: true,
interval: 0,
formatter: function (value) { //关键代码
var res = value
if (res.length > 7) {
res = res.substring(0, 6) + '..'
}
return res
},
},
},

本文灵感来源:https://blog.csdn.net/qq_42477147/article/details/99726811

猜你喜欢

转载自www.cnblogs.com/xiaonanxun/p/11758378.html