AnalyticsTotalProfit.vue
1.85 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
<script setup>
import { useTheme } from 'vuetify'
import { hexToRgb } from '@core/utils/colorConverter'
const vuetifyTheme = useTheme()
const series = [{
data: [
0,
20,
5,
30,
15,
45,
],
}]
const chartOptions = computed(() => {
const currentTheme = vuetifyTheme.current.value.colors
const variableTheme = vuetifyTheme.current.value.variables
return {
chart: {
parentHeightOffset: 0,
toolbar: { show: false },
},
tooltip: { enabled: false },
grid: {
borderColor: `rgba(${ hexToRgb(String(variableTheme['border-color'])) },${ variableTheme['border-opacity'] })`,
strokeDashArray: 6,
xaxis: { lines: { show: true } },
yaxis: { lines: { show: false } },
padding: {
top: -10,
left: -7,
right: 5,
bottom: 5,
},
},
stroke: {
width: 3,
lineCap: 'butt',
curve: 'straight',
},
colors: [currentTheme.primary],
markers: {
size: 6,
offsetY: 4,
offsetX: -2,
strokeWidth: 3,
colors: ['transparent'],
strokeColors: 'transparent',
discrete: [{
size: 5.5,
seriesIndex: 0,
strokeColor: currentTheme.primary,
fillColor: currentTheme.surface,
dataPointIndex: series[0].data.length - 1,
}],
hover: { size: 7 },
},
xaxis: {
labels: { show: false },
axisTicks: { show: false },
axisBorder: { show: false },
},
yaxis: { labels: { show: false } },
}
})
</script>
<template>
<VCard>
<VCardText>
<h4 class="text-h4">
$86.4k
</h4>
<VueApexCharts
type="line"
:options="chartOptions"
:series="series"
:height="80"
class="my-1"
/>
<h6 class="text-h6 text-center">
Total Profit
</h6>
</VCardText>
</VCard>
</template>