code refactor

This commit is contained in:
MaysWind
2021-02-02 23:49:23 +08:00
parent ce1e690934
commit 868e5ce377
3 changed files with 56 additions and 84 deletions
+24 -6
View File
@@ -8,12 +8,30 @@ const allChartTypes = {
const defaultChartType = allChartTypes.Pie;
const allChartDataTypes = {
ExpenseByAccount: 0,
ExpenseByPrimaryCategory: 1,
ExpenseBySecondaryCategory: 2,
IncomeByAccount: 3,
IncomeByPrimaryCategory: 4,
IncomeBySecondaryCategory: 5
ExpenseByAccount: {
type: 0,
name: 'Expense By Account'
},
ExpenseByPrimaryCategory: {
type: 1,
name: 'Expense By Primary Category'
},
ExpenseBySecondaryCategory: {
type: 2,
name: 'Expense By Secondary Category'
},
IncomeByAccount: {
type: 3,
name: 'Income By Account'
},
IncomeByPrimaryCategory: {
type: 4,
name: 'Income By Primary Category'
},
IncomeBySecondaryCategory: {
type: 5,
name: 'Income By Secondary Category'
}
};
const defaultChartDataType = allChartDataTypes.ExpenseByPrimaryCategory;