Fix bot balance not showing

This commit is contained in:
Matthias 2023-09-01 19:53:39 +02:00
parent 421fe3ec34
commit 03257e8469

View File

@ -1,8 +1,10 @@
<template> <template>
<e-charts <e-charts
v-if="currencies" v-if="currencies"
ref="balanceChart"
:option="balanceChartOptions" :option="balanceChartOptions"
:theme="settingsStore.chartTheme" :theme="settingsStore.chartTheme"
:style="{ height: width * 0.6 + 'px' }"
autoresize autoresize
/> />
</template> </template>
@ -24,8 +26,9 @@ import {
import { BalanceValues } from '@/types'; import { BalanceValues } from '@/types';
import { formatPriceCurrency } from '@/shared/formatters'; import { formatPriceCurrency } from '@/shared/formatters';
import { computed } from 'vue'; import { computed, ref } from 'vue';
import { useSettingsStore } from '@/stores/settings'; import { useSettingsStore } from '@/stores/settings';
import { useElementSize } from '@vueuse/core';
use([ use([
PieChart, PieChart,
@ -37,6 +40,9 @@ use([
LabelLayout, LabelLayout,
]); ]);
const balanceChart = ref(null);
const { width } = useElementSize(balanceChart);
const props = defineProps({ const props = defineProps({
currencies: { required: true, type: Array as () => BalanceValues[] }, currencies: { required: true, type: Array as () => BalanceValues[] },
showTitle: { required: false, type: Boolean }, showTitle: { required: false, type: Boolean },
@ -93,8 +99,6 @@ const balanceChartOptions = computed((): EChartsOption => {
<style lang="scss" scoped> <style lang="scss" scoped>
.echarts { .echarts {
width: 100%; min-height: 20px;
height: 100%;
min-height: 240px;
} }
</style> </style>