echarts产品日常奇怪需求
设置最小刻度导致好多小数,限制两位
yAxis 指定的y轴设置 axisLabel,可以格式化显示
文档地址:https://echarts.apache.org/zh/option.html#yAxis.axisLabel.formatter
yAxis: [{type: 'value',name: '利率',position: 'right',alignTicks: true,min: 'dataMin',max: 'dataMax',axisLabel: {//保留两位位小数formatter: function (value) {return value.toFixed(2) + '%'},},axisLine: {show: true,},},
],
效果如图
悬浮的tooltip 被截
解决
tooltip: {confine: true,//限制即可
},
series: []