ECommerceTotalSalesRadial.vue
1.42 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
<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.125rem',
fontWeight: '500',
offsetY: 0,
color: `rgba(${ hexToRgb(currentTheme['on-surface']) },${ variableTheme['medium-emphasis-opacity'] })`,
},
},
track: { background: currentTheme['track-bg'] },
},
},
stroke: { lineCap: 'round' },
responsive: [{
breakpoint: 450,
options: { plotOptions: { radialBar: { hollow: { size: '52%' } } } },
}],
}
})
</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>