Commit 1f9f7aa2 by zhangquan

修复y轴隐藏问题

1 parent 79dd7494
...@@ -39,11 +39,33 @@ export default { ...@@ -39,11 +39,33 @@ export default {
this[this.domId] = echarts.init(this.barLineDom) this[this.domId] = echarts.init(this.barLineDom)
}, },
methods: { methods: {
getLeft(list) {
const maxNum = Math.max(...list)
let left = 6
switch(true){
case maxNum<10:
left=6
break;
case maxNum<100:
left=9
break;
case maxNum<1000:
left=12
break;
case maxNum<10000:
left=15
break;
default:
left=18
break;
}
return `${left}%`
},
drawBarLine() { drawBarLine() {
this.barLineOptions = { this.barLineOptions = {
grid: { grid: {
right: '5%', right: '5%',
left: `${this.linetype == 1 ? '13%' : '5%'}` left: this.getLeft(this.dataList || [0])
}, },
xAxis: { xAxis: {
type: 'category', type: 'category',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!