ChartJsBarChart.vue
1.05 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
<script setup>
import { useTheme } from 'vuetify'
import BarChart from '@/@core/libs/chartjs/components/BarChart'
import { getLatestBarChartConfig } from '@core/libs/chartjs/chartjsConfig'
const props = defineProps({
colors: {
type: null,
required: true,
},
})
const vuetifyTheme = useTheme()
const chartOptions = computed(() => getLatestBarChartConfig(vuetifyTheme.current.value))
const data = {
labels: [
'7/12',
'8/12',
'9/12',
'10/12',
'11/12',
'12/12',
'13/12',
'14/12',
'15/12',
'16/12',
'17/12',
'18/12',
'19/12',
],
datasets: [{
maxBarThickness: 15,
backgroundColor: props.colors.barChartYellow,
borderColor: 'transparent',
borderRadius: {
topRight: 15,
topLeft: 15,
},
data: [
275,
90,
190,
205,
125,
85,
55,
87,
127,
150,
230,
280,
190,
],
}],
}
</script>
<template>
<BarChart
:height="400"
:chart-data="data"
:chart-options="chartOptions"
/>
</template>