Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.7k views
in Technique[技术] by (71.8m points)

echarts如何实现在有datazoom的情况下y轴分隔数固定?

问题描述:
想实现下有datazoom的情况下y轴刻度按照固定分隔数显示,即使datazoom缩放。有这个需求是在移动端,echarts目前y轴动态计算的分隔数不固定,导致有时候在样式上不太美观,出现分隔紧凑并且最上面或者最下方留白较多

自己尝试过方法:
目前已知可以在没有datazoom情况下,通过获取整个数据的最大值最小值,并根据自己想要的分隔数,通过计算设置interval 配合min、max来实现

期待的效果:
在有datazoom的情况下,即使出现缩放,y轴的分隔数也是固定的,只有刻度值在动态变化


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...