CardStatisticsTotalRevenueRadialBarCharts.vue
1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<script setup>
import { useTheme } from 'vuetify'
import { hexToRgb } from '@core/utils/colorConverter'
const vuetifyTheme = useTheme()
const series = [78]
const chartOptions = computed(() => {
const currentTheme = vuetifyTheme.current.value.colors
const variableTheme = vuetifyTheme.current.value.variables
return {
chart: { sparkline: { enabled: true } },
colors: [currentTheme.info],
plotOptions: {
radialBar: {
startAngle: -90,
endAngle: 90,
hollow: { size: '65%' },
dataLabels: {
name: { show: false },
value: {
fontSize: '1.25rem',
fontWeight: '500',
offsetY: 0,
color: `rgba(${ hexToRgb(currentTheme['on-surface']) },${ variableTheme['high-emphasis-opacity'] })`,
},
},
track: { background: currentTheme['track-bg'] },
},
},
stroke: { lineCap: 'round' },
}
})
</script>
<template>
<VCard>
<VCardText>
<h4 class="text-h4">
135k
</h4>
<VueApexCharts
id="stats-radial-bar-chart"
:options="chartOptions"
:series="series"
type="radialBar"
:height="150"
/>
<h6 class="text-h6 text-center mt-6">
Total sales
</h6>
</VCardText>
</VCard>
</template>
<style lang="scss">
#stats-radial-bar-chart {
.apexcharts-canvas {
.apexcharts-text {
&.apexcharts-datalabel-value {
font-weight: 600;
}
}
}
}
</style>