88import type { ECharts , ComposeOption } from "echarts/core"
99import type { PieSeriesOption } from "echarts/charts"
1010import type { TitleComponentOption , TooltipComponentOption } from "echarts/components"
11+ import type { Ref } from "vue"
12+ import type { TimerQueryParam } from "@service/timer-service"
1113
1214import { init , use } from "@echarts/core"
1315import PieChart from "@echarts/chart/pie"
@@ -16,13 +18,14 @@ import TooltipComponent from "@echarts/component/tooltip"
1618
1719use ( [ PieChart , TitleComponent , TooltipComponent ] )
1820
19- import timerService , { SortDirect , TimerQueryParam } from "@service/timer-service"
21+ import timerService , { SortDirect } from "@service/timer-service"
2022import { MILL_PER_DAY } from "@util/time"
2123import { ElLoading } from "element-plus"
22- import { defineComponent , h , onMounted , ref , Ref } from "vue"
24+ import { defineComponent , h , onMounted , ref } from "vue"
2325import DataItem from "@entity/dto/data-item"
2426import { BASE_TITLE_OPTION } from "../common"
2527import { t } from "@app/locale"
28+ import { getPrimaryTextColor } from "@util/style"
2629
2730const CONTAINER_ID = '__timer_dashboard_top_k_visit'
2831const TOP_NUM = 6
@@ -40,10 +43,12 @@ type _Value = {
4043}
4144
4245function optionOf ( data : _Value [ ] ) : EcOption {
46+ const textColor = getPrimaryTextColor ( )
4347 return {
4448 title : {
4549 ...BASE_TITLE_OPTION ,
46- text : t ( msg => msg . dashboard . topK . title , { k : TOP_NUM , day : DAY_NUM } )
50+ text : t ( msg => msg . dashboard . topK . title , { k : TOP_NUM , day : DAY_NUM } ) ,
51+ textStyle : { color : textColor }
4752 } ,
4853 tooltip : {
4954 show : true ,
@@ -64,6 +69,7 @@ function optionOf(data: _Value[]): EcOption {
6469 itemStyle : {
6570 borderRadius : 7
6671 } ,
72+ label : { color : textColor } ,
6773 data : data
6874 }
6975 }
0 commit comments