CardWidgetsTotalVisits.vue
2.41 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<script setup>
import { useTheme } from 'vuetify'
import { hexToRgb } from '@core/utils/colorConverter'
const vuetifyTheme = useTheme()
const options = computed(() => {
const currentTheme = ref(vuetifyTheme.current.value.colors)
const variableTheme = ref(vuetifyTheme.current.value.variables)
const secondaryTextColor = `rgba(${ hexToRgb(currentTheme.value['on-surface']) },${ variableTheme.value['medium-emphasis-opacity'] })`
const primaryTextColor = `rgba(${ hexToRgb(currentTheme.value['on-surface']) },${ variableTheme.value['high-emphasis-opacity'] })`
return {
chart: { sparkline: { enabled: true } },
labels: ['Cricket'],
stroke: { lineCap: 'round' },
grid: { padding: { top: -10 } },
colors: [currentTheme.value.info],
fill: {
type: 'gradient',
gradient: {
shade: 'light',
type: 'horizontal',
shadeIntensity: 0.2,
inverseColors: false,
opacityFrom: 1,
opacityTo: 0.1,
stops: [
0,
90,
],
},
},
states: {
hover: { filter: { type: 'none' } },
active: { filter: { type: 'none' } },
},
plotOptions: {
radialBar: {
endAngle: 180,
startAngle: -180,
inverseOrder: true,
hollow: { size: '62%' },
track: { background: currentTheme.value['track-bg'] },
dataLabels: {
name: { offsetY: 26 },
value: {
offsetY: -14,
fontSize: '24px',
fontWeight: 500,
color: primaryTextColor,
formatter: value => `${ value }k`,
},
total: {
show: true,
label: 'Growth',
fontSize: '15px',
fontWeight: 500,
color: secondaryTextColor,
},
},
},
},
}
})
const series = [78]
</script>
<template>
<VCard>
<VCardItem>
<VCardTitle>Total Visits</VCardTitle>
<template #append>
<div class="me-n3">
<MoreBtn density="compact" />
</div>
</template>
</VCardItem>
<VueApexCharts
type="radialBar"
:options="options"
:series="series"
:height="199"
/>
<VCardText class="text-center pt-0">
<div class="text-body-1 mb-2">
42.2k new visits
</div>
<VChip
color="info"
size="small"
>
This year
</VChip>
</VCardText>
</VCard>
</template>