问题遇到的现象和发生背景
echarts滚动图例自带的页数文本如何去除
问题相关代码,请勿粘贴截图
如图因为这一块的位置太小,只想要留下滚动的按钮,不想要中间的页码,但是目前就是不知道如何将这个页码去除,就算去除了文本,位置也还在,导致图例显示不完全。
我的解答思路和尝试过的方法
legend: {
type: "scroll", // 设置图例翻页
icon: "rect",
itemWidth: 12, // 图例图形宽度
itemHeight: 10,
orient: "horizontal", // 图例横向排布
left: 15, // 图例位置
bottom: 8,
pageFormatter: ' ',
textStyle: {
color: "#fff",
fontSize: 12
},
pageIconColor: "#fff",
pageTextStyle: {
// show:false,
color: "#fff",
width: 0,
height: 0
},
itemGap: 20
},
我把能尝试的都尝试了,最后只能做到去除文本,那个宽度始终无法缩小
pageTextStyle: {
// show:false,
color: "#fff",
width: 0,
height: 0
},
尝试去把pageTextStyle.width设置为0也无法改变