Added chart type selector.
Build and Deploy Web App / build-and-deploy (push) Failing after 11s
Details
Build and Deploy Web App / build-and-deploy (push) Failing after 11s
Details
This commit is contained in:
parent
26f0d88f5d
commit
2d99e96df3
|
|
@ -19,6 +19,17 @@ const balanceTimeSeriesData = ref<BalanceTimeSeriesAnalytics>()
|
||||||
const currency = ref<Currency>()
|
const currency = ref<Currency>()
|
||||||
const timeFrame = ref<TimeFrame>({})
|
const timeFrame = ref<TimeFrame>({})
|
||||||
|
|
||||||
|
interface AnalyticsChartType {
|
||||||
|
id: string
|
||||||
|
name: string
|
||||||
|
}
|
||||||
|
|
||||||
|
const AnalyticsChartTypes: AnalyticsChartType[] = [
|
||||||
|
{ id: 'balance-time-series', name: 'Account Balances' },
|
||||||
|
]
|
||||||
|
|
||||||
|
const selectedChart = ref<AnalyticsChartType>(AnalyticsChartTypes[0])
|
||||||
|
|
||||||
const availableCurrencies = computed(() => {
|
const availableCurrencies = computed(() => {
|
||||||
const currencies: Currency[] = []
|
const currencies: Currency[] = []
|
||||||
for (const acc of accounts.value) {
|
for (const acc of accounts.value) {
|
||||||
|
|
@ -64,9 +75,19 @@ onMounted(async () => {
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<HomeModule title="Analytics">
|
<HomeModule title="Analytics" style="max-width: 800px;">
|
||||||
<BalanceTimeSeriesChart v-if="currency && balanceTimeSeriesData" title="Account Balances" :currency="currency"
|
<FormGroup>
|
||||||
:time-frame="timeFrame" :data="accountBalancesData" />
|
<FormControl label="Chart">
|
||||||
|
<select v-model="selectedChart">
|
||||||
|
<option v-for="ct in AnalyticsChartTypes" :key="ct.id" :value="ct">
|
||||||
|
{{ ct.name }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</FormControl>
|
||||||
|
</FormGroup>
|
||||||
|
|
||||||
|
<BalanceTimeSeriesChart v-if="currency && balanceTimeSeriesData && selectedChart.id === 'balance-time-series'"
|
||||||
|
title="Account Balances" :currency="currency" :time-frame="timeFrame" :data="accountBalancesData" />
|
||||||
|
|
||||||
<FormGroup>
|
<FormGroup>
|
||||||
<FormControl label="Currency">
|
<FormControl label="Currency">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue