From 944b02dce174f30faa4183cb2167a139111d9f2d Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Sun, 6 Mar 2022 07:41:15 +0800 Subject: [PATCH] change axis --- src/views/WalletAccounts.vue | 2 +- src/views/components/charts/EchartScatter.vue | 17 ++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/views/WalletAccounts.vue b/src/views/WalletAccounts.vue index d3356568..032d60ab 100644 --- a/src/views/WalletAccounts.vue +++ b/src/views/WalletAccounts.vue @@ -407,7 +407,7 @@ export default { if (this.calculateByDenom.qty) { Object.entries(this.calculateByDenom.qty).forEach(i => { const price = this.getPrice(i[0]) - total.push([i[1], i[1] * price, price, i[0]]) + total.push([i[1], Math.sqrt(price), i[1] * price, i[0]]) }) } return total diff --git a/src/views/components/charts/EchartScatter.vue b/src/views/components/charts/EchartScatter.vue index dd294db7..efa1acd4 100644 --- a/src/views/components/charts/EchartScatter.vue +++ b/src/views/components/charts/EchartScatter.vue @@ -72,8 +72,9 @@ export default { }, }, yAxis: { - name: 'Value', + name: 'Price', axisLabel: { + show: false, formatter(param) { return formatNumber(param, true, 0) }, @@ -91,21 +92,15 @@ export default { data: this.items, type: 'scatter', symbolSize(data) { - const r = Math.log(data[2]) * 5 - if (r > 50) { - return 50 - } - if (r < 10) { - return 10 - } - return r + const r = Math.log(data[2]) + return r > 50 ? 50 : r }, emphasis: { focus: 'series', label: { show: true, formatter(param) { - return param.data[3] + return `${param.data[3]}, ${formatNumber(param.data[2], true, 0)}` }, position: 'top', }, @@ -114,7 +109,7 @@ export default { shadowBlur: 10, shadowColor: 'rgba(120, 36, 50, 0.5)', shadowOffsetY: 5, - color: '#7367F0', + color: '#28c76f', }, }, ],