@@ -15,8 +15,16 @@ const props = defineProps<{
15
15
data: Trend [];
16
16
}>();
17
17
18
+ const isDark = useDark ({
19
+ selector: " html" ,
20
+ attribute: " data-theme" ,
21
+ valueDark: " dracula" ,
22
+ valueLight: " light" ,
23
+ });
24
+
18
25
const option = computed (() => {
19
26
return {
27
+ backgroundColor: isDark .value ? " #272A34" : " transparent" ,
20
28
tooltip: { trigger: " axis" },
21
29
legend: { show: true },
22
30
grid: {
@@ -25,7 +33,7 @@ const option = computed(() => {
25
33
bottom: 0 ,
26
34
containLabel: true ,
27
35
},
28
- xAxis: { type: " time" },
36
+ xAxis: { type: " time" , axisLabel: { formatter: " {MM}/{dd} " } },
29
37
yAxis: { type: " value" },
30
38
series: [
31
39
{
@@ -35,6 +43,7 @@ const option = computed(() => {
35
43
.filter (({ condition }) => condition === CONDITIONS .USED )
36
44
.map (({ price , posted_at , ptt_article_id }) => [+ new Date (posted_at || " " ), price , ptt_article_id ]),
37
45
symbol: " circle" ,
46
+ symbolSize: 7 ,
38
47
smooth: 0.2 ,
39
48
},
40
49
{
@@ -44,6 +53,7 @@ const option = computed(() => {
44
53
.filter (({ condition }) => condition === CONDITIONS .NEW )
45
54
.map (({ price , posted_at , ptt_article_id }) => [+ new Date (posted_at || " " ), price , ptt_article_id ]),
46
55
symbol: " circle" ,
56
+ symbolSize: 7 ,
47
57
smooth: 0.2 ,
48
58
},
49
59
],
@@ -60,6 +70,6 @@ function handleClick(args: ECElementEvent) {
60
70
61
71
<template >
62
72
<div class =" h-[300px]" >
63
- <v-chart :option =" option" autoresize @click =" handleClick" />
73
+ <v-chart :option =" option" :theme = " isDark ? 'dark' : '' " autoresize @click =" handleClick" />
64
74
</div >
65
75
</template >
0 commit comments