leekbillow commented on issue #16931: URL: https://github.com/apache/echarts/issues/16931#issuecomment-1118326918
@linghaoSu 是的,你明白我的意思,即使设置了固定宽度,自动计算间隔仍然使用最长的label作为计算参考; `overflow: 'truncate'`后,可以自己算好间隔然后`interval: 0`,但是如果同时使用datazoom的话就不太够用了,它不会自动隐藏。 Yes, you see what I mean, even with a fixed width, the automatic calculation interval still uses the longest label as the calculation reference; After `overflow: 'truncate'`, you can calculate the interval and then `interval: 0`, but it is not enough if you use datazoom at the same time, does not automatically hide. ```js option = { xAxis: { type: 'category', data: [ '标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签', '标签标签标签标签标签标签标签标签标签标签', '标签标签标签标签标签标签', '标签标签标签标签标签标签标签标签标签标签', '标签标签标签标签标签标签', '标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签标签', '标签标签', '标签标签标签标签标签标签标签标签' ], axisLabel: { width: 250, overflow: 'truncate', interval: 0 } }, dataZoom: { startValue: 0, endValue: 3 }, yAxis: { type: 'value' }, series: [ { type: 'bar', data: [120, 200, 150, 80, 70, 110, 130, 200] } ] }; ``` ![动画](https://user-images.githubusercontent.com/43409097/166891721-76e079a3-1dea-4900-8b9d-892ee2c98d41.gif) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org