fix: 修复图表组件运行时错误
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 16s
Docker Build & Deploy / Deploy to Production (push) Successful in 6s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 16s
Docker Build & Deploy / Deploy to Production (push) Successful in 6s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
- 将 getChartOptionsByType 替换为 getChartOptions - 修复 MonthlyExpenseCard.vue 中的图表配置 - 修复 ExpenseCategoryCard.vue 中的图表配置 - 修复 BudgetChartAnalysis.vue 中的图表配置 - 统计页面、日历页面、预算页面运行正常,无控制台错误
This commit is contained in:
@@ -239,7 +239,7 @@ const showDescriptionPopup = ref(false)
|
|||||||
const activeDescTab = ref('month')
|
const activeDescTab = ref('month')
|
||||||
|
|
||||||
// Chart.js 相关
|
// Chart.js 相关
|
||||||
const { getChartOptions, getChartOptionsByType } = useChartTheme()
|
const { getChartOptions } = useChartTheme()
|
||||||
|
|
||||||
const formatMoney = (val) => {
|
const formatMoney = (val) => {
|
||||||
if (Math.abs(val) >= 10000) {
|
if (Math.abs(val) >= 10000) {
|
||||||
@@ -500,7 +500,7 @@ const varianceChartData = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const varianceChartOptions = computed(() => {
|
const varianceChartOptions = computed(() => {
|
||||||
return getChartOptionsByType('bar', {
|
return getChartOptions({
|
||||||
indexAxis: 'y',
|
indexAxis: 'y',
|
||||||
plugins: {
|
plugins: {
|
||||||
legend: {
|
legend: {
|
||||||
@@ -655,7 +655,7 @@ const burndownChartData = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const burndownChartOptions = computed(() => {
|
const burndownChartOptions = computed(() => {
|
||||||
return getChartOptionsByType('line', {
|
return getChartOptions({
|
||||||
plugins: {
|
plugins: {
|
||||||
legend: {
|
legend: {
|
||||||
display: true,
|
display: true,
|
||||||
@@ -816,7 +816,7 @@ const yearBurndownChartData = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const yearBurndownChartOptions = computed(() => {
|
const yearBurndownChartOptions = computed(() => {
|
||||||
return getChartOptionsByType('line', {
|
return getChartOptions({
|
||||||
plugins: {
|
plugins: {
|
||||||
legend: {
|
legend: {
|
||||||
display: true,
|
display: true,
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ defineEmits(['category-click'])
|
|||||||
const showAllExpense = ref(false)
|
const showAllExpense = ref(false)
|
||||||
|
|
||||||
// Chart.js 相关
|
// Chart.js 相关
|
||||||
const { getChartOptionsByType } = useChartTheme()
|
const { getChartOptions } = useChartTheme()
|
||||||
let _chartJSInstance = null
|
let _chartJSInstance = null
|
||||||
|
|
||||||
// 饼图标签引导线
|
// 饼图标签引导线
|
||||||
@@ -307,7 +307,7 @@ const totalAmount = computed(() => {
|
|||||||
const chartOptions = computed(() => {
|
const chartOptions = computed(() => {
|
||||||
const isDarkMode = document.documentElement.getAttribute('data-theme') === 'dark'
|
const isDarkMode = document.documentElement.getAttribute('data-theme') === 'dark'
|
||||||
|
|
||||||
return getChartOptionsByType('doughnut', {
|
return getChartOptions({
|
||||||
cutout: '65%',
|
cutout: '65%',
|
||||||
layout: {
|
layout: {
|
||||||
padding: {
|
padding: {
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ const props = defineProps({
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Chart.js 相关
|
// Chart.js 相关
|
||||||
const { getChartOptionsByType, colors } = useChartTheme()
|
const { getChartOptions, colors } = useChartTheme()
|
||||||
|
|
||||||
// 计算结余样式类
|
// 计算结余样式类
|
||||||
const balanceClass = computed(() => ({
|
const balanceClass = computed(() => ({
|
||||||
@@ -281,7 +281,7 @@ const chartData = computed(() => {
|
|||||||
const chartOptions = computed(() => {
|
const chartOptions = computed(() => {
|
||||||
const { chartData: rawData } = prepareChartData()
|
const { chartData: rawData } = prepareChartData()
|
||||||
|
|
||||||
return getChartOptionsByType('line', {
|
return getChartOptions({
|
||||||
scales: {
|
scales: {
|
||||||
x: { display: false },
|
x: { display: false },
|
||||||
y: { display: false }
|
y: { display: false }
|
||||||
|
|||||||
Reference in New Issue
Block a user