change axis

This commit is contained in:
liangping 2022-03-06 07:41:15 +08:00
parent 976ebef410
commit 944b02dce1
2 changed files with 7 additions and 12 deletions

View File

@ -407,7 +407,7 @@ export default {
if (this.calculateByDenom.qty) { if (this.calculateByDenom.qty) {
Object.entries(this.calculateByDenom.qty).forEach(i => { Object.entries(this.calculateByDenom.qty).forEach(i => {
const price = this.getPrice(i[0]) 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 return total

View File

@ -72,8 +72,9 @@ export default {
}, },
}, },
yAxis: { yAxis: {
name: 'Value', name: 'Price',
axisLabel: { axisLabel: {
show: false,
formatter(param) { formatter(param) {
return formatNumber(param, true, 0) return formatNumber(param, true, 0)
}, },
@ -91,21 +92,15 @@ export default {
data: this.items, data: this.items,
type: 'scatter', type: 'scatter',
symbolSize(data) { symbolSize(data) {
const r = Math.log(data[2]) * 5 const r = Math.log(data[2])
if (r > 50) { return r > 50 ? 50 : r
return 50
}
if (r < 10) {
return 10
}
return r
}, },
emphasis: { emphasis: {
focus: 'series', focus: 'series',
label: { label: {
show: true, show: true,
formatter(param) { formatter(param) {
return param.data[3] return `${param.data[3]}, ${formatNumber(param.data[2], true, 0)}`
}, },
position: 'top', position: 'top',
}, },
@ -114,7 +109,7 @@ export default {
shadowBlur: 10, shadowBlur: 10,
shadowColor: 'rgba(120, 36, 50, 0.5)', shadowColor: 'rgba(120, 36, 50, 0.5)',
shadowOffsetY: 5, shadowOffsetY: 5,
color: '#7367F0', color: '#28c76f',
}, },
}, },
], ],