From 3aa8c63fe4f3c19a6198f485f11804fad1aa23d7 Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Sat, 12 Mar 2022 20:12:42 +0800 Subject: [PATCH] fix overlap of legend. --- src/views/components/charts/EchartScatter.vue | 46 ++----------------- 1 file changed, 4 insertions(+), 42 deletions(-) diff --git a/src/views/components/charts/EchartScatter.vue b/src/views/components/charts/EchartScatter.vue index 842e2146..a061c767 100644 --- a/src/views/components/charts/EchartScatter.vue +++ b/src/views/components/charts/EchartScatter.vue @@ -73,25 +73,19 @@ export default { return { title: { text: '', - left: '5%', - top: '3%', }, legend: { - right: '10%', - top: '3%', + scroll: 'scroll', data: assets, textStyle: { color: '#aaa', }, + top: 'top', }, + grid: { top: `${assets.length > 30 ? 30 : assets.length + 20}%` }, // */ xAxis: { name: 'Qty', nameLocation: 'center', - splitLine: { - lineStyle: { - type: 'dashed', - }, - }, axisLabel: { show: false, formatter(param) { @@ -108,41 +102,9 @@ export default { return formatNumber(param, true, 0) }, }, - splitLine: { - lineStyle: { - type: 'dashed', - }, - }, scale: true, }, series, - // series: [ - // { - // name: '', - // data: this.items.filter(x => x[1] > 0), - // type: 'scatter', - // symbolSize(data) { - // const r = Math.log10(data[2]) - // return r * 5 - // }, - // emphasis: { - // focus: 'series', - // label: { - // show: true, - // formatter(param) { - // return `${param.data[3]}, ${formatNumber(param.data[2], true, 0)}` - // }, - // position: 'top', - // }, - // }, - // itemStyle: { - // shadowBlur: 10, - // shadowColor: 'rgba(120, 36, 50, 0.5)', - // shadowOffsetY: 5, - // color: '#28c76f', - // }, - // }, - // ], } }, }, @@ -151,7 +113,7 @@ export default {