diff --git a/Web/src/components/Budget/BudgetChartAnalysis.vue b/Web/src/components/Budget/BudgetChartAnalysis.vue index af4a194..b2c1e35 100644 --- a/Web/src/components/Budget/BudgetChartAnalysis.vue +++ b/Web/src/components/Budget/BudgetChartAnalysis.vue @@ -239,7 +239,7 @@ const showDescriptionPopup = ref(false) const activeDescTab = ref('month') // Chart.js 相关 -const { getChartOptions, getChartOptionsByType } = useChartTheme() +const { getChartOptions } = useChartTheme() const formatMoney = (val) => { if (Math.abs(val) >= 10000) { @@ -500,7 +500,7 @@ const varianceChartData = computed(() => { }) const varianceChartOptions = computed(() => { - return getChartOptionsByType('bar', { + return getChartOptions({ indexAxis: 'y', plugins: { legend: { @@ -655,7 +655,7 @@ const burndownChartData = computed(() => { }) const burndownChartOptions = computed(() => { - return getChartOptionsByType('line', { + return getChartOptions({ plugins: { legend: { display: true, @@ -816,7 +816,7 @@ const yearBurndownChartData = computed(() => { }) const yearBurndownChartOptions = computed(() => { - return getChartOptionsByType('line', { + return getChartOptions({ plugins: { legend: { display: true, diff --git a/Web/src/views/statisticsV2/modules/ExpenseCategoryCard.vue b/Web/src/views/statisticsV2/modules/ExpenseCategoryCard.vue index 549558f..065b2f2 100644 --- a/Web/src/views/statisticsV2/modules/ExpenseCategoryCard.vue +++ b/Web/src/views/statisticsV2/modules/ExpenseCategoryCard.vue @@ -110,7 +110,7 @@ defineEmits(['category-click']) const showAllExpense = ref(false) // Chart.js 相关 -const { getChartOptionsByType } = useChartTheme() +const { getChartOptions } = useChartTheme() let _chartJSInstance = null // 饼图标签引导线 @@ -307,7 +307,7 @@ const totalAmount = computed(() => { const chartOptions = computed(() => { const isDarkMode = document.documentElement.getAttribute('data-theme') === 'dark' - return getChartOptionsByType('doughnut', { + return getChartOptions({ cutout: '65%', layout: { padding: { diff --git a/Web/src/views/statisticsV2/modules/MonthlyExpenseCard.vue b/Web/src/views/statisticsV2/modules/MonthlyExpenseCard.vue index 184cf63..176df26 100644 --- a/Web/src/views/statisticsV2/modules/MonthlyExpenseCard.vue +++ b/Web/src/views/statisticsV2/modules/MonthlyExpenseCard.vue @@ -80,7 +80,7 @@ const props = defineProps({ }) // Chart.js 相关 -const { getChartOptionsByType, colors } = useChartTheme() +const { getChartOptions, colors } = useChartTheme() // 计算结余样式类 const balanceClass = computed(() => ({ @@ -281,7 +281,7 @@ const chartData = computed(() => { const chartOptions = computed(() => { const { chartData: rawData } = prepareChartData() - return getChartOptionsByType('line', { + return getChartOptions({ scales: { x: { display: false }, y: { display: false }