@@ -329,7 +340,7 @@ export default {
}
}
- const allStatisticsData = [];
+ const allStatisticsItems = [];
for (let id in combinedData) {
if (!Object.prototype.hasOwnProperty.call(combinedData, id)) {
@@ -339,14 +350,17 @@ export default {
const data = combinedData[id];
data.percent = data.totalAmount * 100 / allAmount;
- allStatisticsData.push(data);
+ allStatisticsItems.push(data);
}
- allStatisticsData.sort(function (data1, data2) {
+ allStatisticsItems.sort(function (data1, data2) {
return data2.totalAmount - data1.totalAmount;
});
- return allStatisticsData;
+ return {
+ totalAmount: allAmount,
+ items: allStatisticsItems
+ };
},
chartData() {
const self = this;
@@ -359,8 +373,8 @@ export default {
const allData = [];
- for (let i = 0; i < this.statisticsData.length; i++) {
- const data = this.statisticsData[i];
+ for (let i = 0; i < this.statisticsData.items.length; i++) {
+ const data = this.statisticsData.items[i];
allData.push({
name: data.name,
@@ -657,11 +671,22 @@ export default {