mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 23:56:42 +08:00
fix apexchats datalabels
This commit is contained in:
+30
@@ -11,6 +11,36 @@ async function setTheme() {
|
|||||||
globalTheme.name.value = themeValue === 'auto' ? autoTheme : themeValue
|
globalTheme.name.value = themeValue === 'auto' ? autoTheme : themeValue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ApexCharts 全局配置
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
Apex: any
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (window.Apex) {
|
||||||
|
// 数据标签
|
||||||
|
window.Apex.dataLabels = {
|
||||||
|
formatter: function (_: number, { seriesIndex, w }: { seriesIndex: number; w: any }) {
|
||||||
|
// 如果有小数点,保留两位小数,否则保留整数
|
||||||
|
const data = w.config.series[seriesIndex]
|
||||||
|
return data.toFixed(data % 1 === 0 ? 0 : 1)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
// 图例
|
||||||
|
window.Apex.legend = {
|
||||||
|
labels: {
|
||||||
|
useSeriesColors: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
// 标题
|
||||||
|
window.Apex.title = {
|
||||||
|
style: {
|
||||||
|
color: 'rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity))',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 页面加载时,加载当前用户数据
|
// 页面加载时,加载当前用户数据
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
setTheme()
|
setTheme()
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ interface RenderProps {
|
|||||||
const elementProps = defineProps({
|
const elementProps = defineProps({
|
||||||
config: Object as PropType<RenderProps>,
|
config: Object as PropType<RenderProps>,
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log(elementProps.config)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -64,5 +64,6 @@ app
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
.use(PerfectScrollbarPlugin)
|
.use(PerfectScrollbarPlugin)
|
||||||
|
.use(VueApexCharts)
|
||||||
.mount('#app')
|
.mount('#app')
|
||||||
.$nextTick(() => removeEl('#loading-bg'))
|
.$nextTick(() => removeEl('#loading-bg'))
|
||||||
|
|||||||
Reference in New Issue
Block a user