yAxis: {
...
min: function(value) {
//取最小值向下取整为最小刻度
return Math.floor(value.min);
},
max: function(value) {
//取最大值向上取整为最大刻度
let integer = Math.ceil(value.max / 0.75);
let length = String(integer).length;
console.log((Math.ceil(integer / Math.pow(10, length - 2)) * Math.pow(10, length - 2)))
return (Math.ceil(integer / Math.pow(10, length - 2)) * Math.pow(10, length - 2));
},
},
echarts控制柱状图最大的高度占3/4,留1/4空白
最新推荐文章于 2024-07-31 11:41:46 发布