diff --git a/src/consts/statistics.js b/src/consts/statistics.js
index 675619a1..a5b0a4e0 100644
--- a/src/consts/statistics.js
+++ b/src/consts/statistics.js
@@ -44,10 +44,20 @@ const allChartDataTypes = {
const defaultChartDataType = allChartDataTypes.ExpenseByPrimaryCategory;
+const allSortingTypes = {
+ ByAmount: 0,
+ ByDisplayOrder: 1,
+ ByName: 2
+};
+
+const defaultSortingType = allSortingTypes.ByAmount;
+
export default {
allChartTypes: allChartTypes,
defaultChartType: defaultChartType,
allChartDataTypes: allChartDataTypes,
defaultChartDataType: defaultChartDataType,
defaultDataRangeType: datetime.allDateRanges.ThisMonth.type,
+ allSortingTypes: allSortingTypes,
+ defaultSortingType: defaultSortingType,
};
diff --git a/src/lib/settings.js b/src/lib/settings.js
index 583644de..5ba09d7e 100644
--- a/src/lib/settings.js
+++ b/src/lib/settings.js
@@ -18,7 +18,8 @@ const defaultSettings = {
statistics: {
defaultChartType: statisticsConstants.defaultChartType,
defaultChartDataType: statisticsConstants.defaultChartDataType,
- defaultDataRangeType: statisticsConstants.defaultDataRangeType
+ defaultDataRangeType: statisticsConstants.defaultDataRangeType,
+ sortingType: statisticsConstants.defaultSortingType
},
animate: true,
autoDarkMode: true
@@ -133,6 +134,8 @@ export default {
setStatisticsDefaultChartDataType: value => setSubOption('statistics', 'defaultChartDataType', value),
getStatisticsDefaultDateRange: () => getSubOption('statistics', 'defaultDataRangeType'),
setStatisticsDefaultDateRange: value => setSubOption('statistics', 'defaultDataRangeType', value),
+ getStatisticsSortingType: () => getSubOption('statistics', 'sortingType'),
+ setStatisticsSortingType: value => setSubOption('statistics', 'sortingType', value),
isEnableAnimate: () => getOption('animate'),
setEnableAnimate: value => setOption('animate', value),
isEnableAutoDarkMode: () => getOption('autoDarkMode'),
diff --git a/src/locales/en.js b/src/locales/en.js
index c5f2e432..5cb7dec3 100644
--- a/src/locales/en.js
+++ b/src/locales/en.js
@@ -669,6 +669,10 @@ export default {
'Default Chart Type': 'Default Chart Type',
'Default Chart Data Type': 'Default Chart Data Type',
'Default Date Range': 'Default Date Range',
+ 'Sort By': 'Sort By',
+ 'By Amount': 'By Amount',
+ 'By Display Order': 'By Display Order',
+ 'By Name': 'By Name',
'Filter Accounts': 'Filter Accounts',
'Filter Transaction Categories': 'Filter Transaction Categories',
'User Profile': 'User Profile',
diff --git a/src/locales/zh_Hans.js b/src/locales/zh_Hans.js
index b2564d5c..bcda7d0b 100644
--- a/src/locales/zh_Hans.js
+++ b/src/locales/zh_Hans.js
@@ -669,6 +669,10 @@ export default {
'Default Chart Type': '默认图表类型',
'Default Chart Data Type': '默认图表数据类型',
'Default Date Range': '默认时间范围',
+ 'Sort By': '排序方式',
+ 'By Amount': '金额',
+ 'By Display Order': '显示顺序',
+ 'By Name': '名称',
'Filter Accounts': '过滤账户',
'Filter Transaction Categories': '过滤交易类型',
'User Profile': '用户信息',
diff --git a/src/views/mobile/statistics/Settings.vue b/src/views/mobile/statistics/Settings.vue
index cef35476..dd74a030 100644
--- a/src/views/mobile/statistics/Settings.vue
+++ b/src/views/mobile/statistics/Settings.vue
@@ -33,6 +33,16 @@
:value="dateRange.type">{{ dateRange.name | localized }}
+
+
+
+
@@ -85,6 +95,14 @@ export default {
set: function (value) {
this.$settings.setStatisticsDefaultDateRange(value);
}
+ },
+ sortBy: {
+ get: function () {
+ return this.$settings.getStatisticsSortingType();
+ },
+ set: function (value) {
+ this.$settings.setStatisticsSortingType(value);
+ }
}
}
};
diff --git a/src/views/mobile/statistics/Transaction.vue b/src/views/mobile/statistics/Transaction.vue
index ac2cbeee..fc5bfcd7 100644
--- a/src/views/mobile/statistics/Transaction.vue
+++ b/src/views/mobile/statistics/Transaction.vue
@@ -248,8 +248,11 @@