echarts 实现双Y轴刻度对齐

编程入门 行业动态 更新时间:2024-10-09 07:24:21

echarts 实现双Y轴<a href=https://www.elefans.com/category/jswz/34/1727415.html style=刻度对齐"/>

echarts 实现双Y轴刻度对齐

话不多说,直接上代码:

min: min2,
max: max2,
splitNumber: 5,
interval: (max2 - min2) / 5,
const min1 = this._getMinValue(dataArr1),min2 = this._getMinValue(dataArr2),max1 = this._getMaxValue(dataArr1),max2 = this._getMaxValue(dataArr2);
	        _getMinValue(arr) {const min = Math.min(...arr);// 这样处理是为了不让最大值刚好到坐标轴最底部return Math.floor(min / 12) * 10;},_getMaxValue(arr) {const max = Math.max(...arr);// 这样处理是为了不让最大值刚好到坐标轴最顶部return Math.ceil(max / 9.5) * 10;},

最后,完美实现双y轴刻度对齐,666

更多推荐

echarts 实现双Y轴刻度对齐

本文发布于:2023-12-04 04:11:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1659715.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:刻度   echarts

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!