mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 16:24:25 +08:00
add chart type and chart data type settings for trend analysis
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import datetime from './datetime.js';
|
||||
|
||||
const allAnalysisTypes = {
|
||||
CategoricalAnalysis: 0,
|
||||
TrendAnalysis: 1
|
||||
};
|
||||
|
||||
const allCategoricalChartTypes = {
|
||||
Pie: 0,
|
||||
Bar: 1
|
||||
@@ -18,38 +23,86 @@ const allCategoricalChartTypesArray = [
|
||||
|
||||
const defaultCategoricalChartType = allCategoricalChartTypes.Pie;
|
||||
|
||||
const allTrendChartTypes = {
|
||||
Area: 0,
|
||||
Column: 1
|
||||
};
|
||||
|
||||
const allTrendChartTypesArray = [
|
||||
{
|
||||
name: 'Area Chart',
|
||||
type: allTrendChartTypes.Area
|
||||
},
|
||||
{
|
||||
name: 'Column Chart',
|
||||
type: allTrendChartTypes.Column
|
||||
}
|
||||
];
|
||||
|
||||
const defaultTrendChartType = allTrendChartTypes.Area;
|
||||
|
||||
const allChartDataTypes = {
|
||||
ExpenseByAccount: {
|
||||
type: 0,
|
||||
name: 'Expense By Account'
|
||||
name: 'Expense By Account',
|
||||
availableAnalysisTypes: {
|
||||
[allAnalysisTypes.CategoricalAnalysis]: true,
|
||||
[allAnalysisTypes.TrendAnalysis]: true,
|
||||
}
|
||||
},
|
||||
ExpenseByPrimaryCategory: {
|
||||
type: 1,
|
||||
name: 'Expense By Primary Category'
|
||||
name: 'Expense By Primary Category',
|
||||
availableAnalysisTypes: {
|
||||
[allAnalysisTypes.CategoricalAnalysis]: true,
|
||||
[allAnalysisTypes.TrendAnalysis]: true,
|
||||
}
|
||||
},
|
||||
ExpenseBySecondaryCategory: {
|
||||
type: 2,
|
||||
name: 'Expense By Secondary Category'
|
||||
name: 'Expense By Secondary Category',
|
||||
availableAnalysisTypes: {
|
||||
[allAnalysisTypes.CategoricalAnalysis]: true,
|
||||
[allAnalysisTypes.TrendAnalysis]: true,
|
||||
}
|
||||
},
|
||||
IncomeByAccount: {
|
||||
type: 3,
|
||||
name: 'Income By Account'
|
||||
name: 'Income By Account',
|
||||
availableAnalysisTypes: {
|
||||
[allAnalysisTypes.CategoricalAnalysis]: true,
|
||||
[allAnalysisTypes.TrendAnalysis]: true,
|
||||
}
|
||||
},
|
||||
IncomeByPrimaryCategory: {
|
||||
type: 4,
|
||||
name: 'Income By Primary Category'
|
||||
name: 'Income By Primary Category',
|
||||
availableAnalysisTypes: {
|
||||
[allAnalysisTypes.CategoricalAnalysis]: true,
|
||||
[allAnalysisTypes.TrendAnalysis]: true,
|
||||
}
|
||||
},
|
||||
IncomeBySecondaryCategory: {
|
||||
type: 5,
|
||||
name: 'Income By Secondary Category'
|
||||
name: 'Income By Secondary Category',
|
||||
availableAnalysisTypes: {
|
||||
[allAnalysisTypes.CategoricalAnalysis]: true,
|
||||
[allAnalysisTypes.TrendAnalysis]: true,
|
||||
}
|
||||
},
|
||||
AccountTotalAssets: {
|
||||
type: 6,
|
||||
name: 'Account Total Assets'
|
||||
name: 'Account Total Assets',
|
||||
availableAnalysisTypes: {
|
||||
[allAnalysisTypes.CategoricalAnalysis]: true
|
||||
}
|
||||
},
|
||||
AccountTotalLiabilities: {
|
||||
type: 7,
|
||||
name: 'Account Total Liabilities'
|
||||
name: 'Account Total Liabilities',
|
||||
availableAnalysisTypes: {
|
||||
[allAnalysisTypes.CategoricalAnalysis]: true
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -82,9 +135,13 @@ const allSortingTypesArray = [
|
||||
const defaultSortingType = allSortingTypes.Amount.type;
|
||||
|
||||
export default {
|
||||
allAnalysisTypes: allAnalysisTypes,
|
||||
allCategoricalChartTypes: allCategoricalChartTypes,
|
||||
allCategoricalChartTypesArray: allCategoricalChartTypesArray,
|
||||
defaultCategoricalChartType: defaultCategoricalChartType,
|
||||
allTrendChartTypes: allTrendChartTypes,
|
||||
allTrendChartTypesArray: allTrendChartTypesArray,
|
||||
defaultTrendChartType: defaultTrendChartType,
|
||||
allChartDataTypes: allChartDataTypes,
|
||||
defaultChartDataType: defaultChartDataType,
|
||||
defaultDataRangeType: datetime.allDateRanges.ThisMonth.type,
|
||||
|
||||
Reference in New Issue
Block a user