fix
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 20s
Docker Build & Deploy / Deploy to Production (push) Successful in 5s
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 20s
Docker Build & Deploy / Deploy to Production (push) Successful in 5s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
This commit is contained in:
@@ -134,7 +134,7 @@ const chartData = computed(() => {
|
|||||||
label: '支出',
|
label: '支出',
|
||||||
data: expenseData,
|
data: expenseData,
|
||||||
borderColor: '#ff6b6b',
|
borderColor: '#ff6b6b',
|
||||||
yAxisID: 'yExpense',
|
yAxisID: 'y',
|
||||||
order: 2,
|
order: 2,
|
||||||
backgroundColor: (context) => {
|
backgroundColor: (context) => {
|
||||||
const chart = context.chart
|
const chart = context.chart
|
||||||
@@ -152,7 +152,7 @@ const chartData = computed(() => {
|
|||||||
label: '收入',
|
label: '收入',
|
||||||
data: incomeData,
|
data: incomeData,
|
||||||
borderColor: '#4ade80',
|
borderColor: '#4ade80',
|
||||||
yAxisID: 'yIncome',
|
yAxisID: 'y',
|
||||||
order: 1,
|
order: 1,
|
||||||
backgroundColor: (context) => {
|
backgroundColor: (context) => {
|
||||||
const chart = context.chart
|
const chart = context.chart
|
||||||
@@ -175,8 +175,14 @@ const chartOptions = computed(() => {
|
|||||||
const { chartData: rawData, expenseData, incomeData } = prepareChartData()
|
const { chartData: rawData, expenseData, incomeData } = prepareChartData()
|
||||||
const maxExpense = Math.max(...expenseData, 0)
|
const maxExpense = Math.max(...expenseData, 0)
|
||||||
const maxIncome = Math.max(...incomeData, 0)
|
const maxIncome = Math.max(...incomeData, 0)
|
||||||
|
const maxValue = Math.max(maxExpense, maxIncome, 0)
|
||||||
|
|
||||||
return getChartOptions({
|
return getChartOptions({
|
||||||
|
layout: {
|
||||||
|
padding: {
|
||||||
|
bottom: 6
|
||||||
|
}
|
||||||
|
},
|
||||||
scales: {
|
scales: {
|
||||||
x: {
|
x: {
|
||||||
display: false,
|
display: false,
|
||||||
@@ -188,23 +194,10 @@ const chartOptions = computed(() => {
|
|||||||
display: false,
|
display: false,
|
||||||
grid: { display: false, drawBorder: false },
|
grid: { display: false, drawBorder: false },
|
||||||
ticks: { display: false },
|
ticks: { display: false },
|
||||||
border: { display: false }
|
border: { display: false },
|
||||||
},
|
|
||||||
yIncome: {
|
|
||||||
display: false,
|
|
||||||
beginAtZero: true,
|
beginAtZero: true,
|
||||||
suggestedMax: maxIncome ? maxIncome * 1.1 : undefined,
|
suggestedMax: maxValue ? maxValue * 1.1 : undefined,
|
||||||
grid: { display: false, drawBorder: false },
|
grace: '6%'
|
||||||
ticks: { display: false },
|
|
||||||
border: { display: false }
|
|
||||||
},
|
|
||||||
yExpense: {
|
|
||||||
display: false,
|
|
||||||
beginAtZero: true,
|
|
||||||
suggestedMax: maxExpense ? maxExpense * 1.1 : undefined,
|
|
||||||
grid: { display: false, drawBorder: false },
|
|
||||||
ticks: { display: false },
|
|
||||||
border: { display: false }
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
plugins: {
|
plugins: {
|
||||||
@@ -274,6 +267,6 @@ const chartOptions = computed(() => {
|
|||||||
|
|
||||||
.trend-chart {
|
.trend-chart {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 180px;
|
height: 190px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ const chartData = computed(() => {
|
|||||||
label: '支出',
|
label: '支出',
|
||||||
data: expenseData,
|
data: expenseData,
|
||||||
borderColor: expenseColor.value,
|
borderColor: expenseColor.value,
|
||||||
yAxisID: 'yExpense',
|
yAxisID: 'y',
|
||||||
order: 2,
|
order: 2,
|
||||||
backgroundColor: (context) => {
|
backgroundColor: (context) => {
|
||||||
const chart = context.chart
|
const chart = context.chart
|
||||||
@@ -262,7 +262,7 @@ const chartData = computed(() => {
|
|||||||
label: '收入',
|
label: '收入',
|
||||||
data: incomeData,
|
data: incomeData,
|
||||||
borderColor: incomeColor.value,
|
borderColor: incomeColor.value,
|
||||||
yAxisID: 'yIncome',
|
yAxisID: 'y',
|
||||||
order: 1,
|
order: 1,
|
||||||
backgroundColor: (context) => {
|
backgroundColor: (context) => {
|
||||||
const chart = context.chart
|
const chart = context.chart
|
||||||
@@ -288,8 +288,14 @@ const chartOptions = computed(() => {
|
|||||||
const { chartData: rawData, expenseData, incomeData } = prepareChartData()
|
const { chartData: rawData, expenseData, incomeData } = prepareChartData()
|
||||||
const maxExpense = Math.max(...expenseData, 0)
|
const maxExpense = Math.max(...expenseData, 0)
|
||||||
const maxIncome = Math.max(...incomeData, 0)
|
const maxIncome = Math.max(...incomeData, 0)
|
||||||
|
const maxValue = Math.max(maxExpense, maxIncome, 0)
|
||||||
|
|
||||||
return getChartOptions({
|
return getChartOptions({
|
||||||
|
layout: {
|
||||||
|
padding: {
|
||||||
|
bottom: 6
|
||||||
|
}
|
||||||
|
},
|
||||||
scales: {
|
scales: {
|
||||||
x: {
|
x: {
|
||||||
display: false,
|
display: false,
|
||||||
@@ -301,23 +307,10 @@ const chartOptions = computed(() => {
|
|||||||
display: false,
|
display: false,
|
||||||
grid: { display: false, drawBorder: false },
|
grid: { display: false, drawBorder: false },
|
||||||
ticks: { display: false },
|
ticks: { display: false },
|
||||||
border: { display: false }
|
border: { display: false },
|
||||||
},
|
|
||||||
yIncome: {
|
|
||||||
display: false,
|
|
||||||
beginAtZero: true,
|
beginAtZero: true,
|
||||||
suggestedMax: maxIncome ? maxIncome * 1.1 : undefined,
|
suggestedMax: maxValue ? maxValue * 1.1 : undefined,
|
||||||
grid: { display: false, drawBorder: false },
|
grace: '6%'
|
||||||
ticks: { display: false },
|
|
||||||
border: { display: false }
|
|
||||||
},
|
|
||||||
yExpense: {
|
|
||||||
display: false,
|
|
||||||
beginAtZero: true,
|
|
||||||
suggestedMax: maxExpense ? maxExpense * 1.1 : undefined,
|
|
||||||
grid: { display: false, drawBorder: false },
|
|
||||||
ticks: { display: false },
|
|
||||||
border: { display: false }
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
plugins: {
|
plugins: {
|
||||||
@@ -462,7 +455,7 @@ const chartOptions = computed(() => {
|
|||||||
|
|
||||||
.trend-chart {
|
.trend-chart {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 140px;
|
height: 200px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user