Fix Bad balance chart

This commit is contained in:
Matthias 2022-01-06 09:11:36 +01:00
parent 1cfc06415d
commit e9ad00d59b

View File

@ -25,6 +25,7 @@ import {
} from 'echarts/components'; } from 'echarts/components';
import { BalanceInterface } from '@/types'; import { BalanceInterface } from '@/types';
import { formatPriceCurrency } from '@/shared/formatters';
use([ use([
PieChart, PieChart,
@ -62,6 +63,12 @@ export default class BalanceChart extends Vue {
}, },
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
formatter: (params) => {
console.log(params);
return `${formatPriceCurrency(params.value.balance, params.value.currency, 8)}<br />${
params.percent
}% (${formatPriceCurrency(params.value.est_stake, params.value.stake)})`;
},
}, },
// legend: { // legend: {
// orient: 'vertical', // orient: 'vertical',
@ -73,9 +80,10 @@ export default class BalanceChart extends Vue {
{ {
type: 'pie', type: 'pie',
radius: ['40%', '70%'], radius: ['40%', '70%'],
encode: { encode: {
x: 'est_stake', value: 'est_stake',
itemName: ['currency'], itemName: 'currency',
tooltip: ['balance', 'currency'], tooltip: ['balance', 'currency'],
}, },
label: { label: {