From 1989188d2a7b1e1f2e1c8043ae3d48a4a12cf52b Mon Sep 17 00:00:00 2001 From: michikQ Date: Wed, 19 Oct 2016 15:06:24 -0400 Subject: [PATCH 1/3] Adding Aggregation by Leaf Story Plan Estimate --- Calculator.js | 7 ++++++- CustomChartApp.js | 5 +++-- deploy/App-external.html | 4 ++-- deploy/App-uncompressed.html | 12 +++++++++--- deploy/App.html | 4 ++-- 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/Calculator.js b/Calculator.js index 935f821..8609b55 100644 --- a/Calculator.js +++ b/Calculator.js @@ -10,6 +10,7 @@ Ext.define('Calculator', { }, prepareChartData: function(store) { + var that = this; var data = _.groupBy(store.getRange(), function(record) { var value = record.get(this.field); return _.isObject(value) ? value._refObjectName : value; @@ -24,7 +25,11 @@ Ext.define('Calculator', { } else { seriesData = _.map(data, function(value, key) { var planEstimateTotal = _.reduce(value, function(total, r) { - return total + r.get('PlanEstimate'); + if(that.calculationType === 'leafplanest') { + return total + r.get('LeafStoryPlanEstimateTotal'); + }else { + return total + r.get('PlanEstimate'); + } }, 0); return [key, planEstimateTotal]; }); diff --git a/CustomChartApp.js b/CustomChartApp.js index 087cf39..2fe743a 100644 --- a/CustomChartApp.js +++ b/CustomChartApp.js @@ -139,7 +139,8 @@ Ext.define('CustomChartApp', { fields: ['name', 'value'], data: [ { name: 'Count', value: 'count' }, - { name: 'Plan Estimate', value: 'estimate' } + { name: 'Plan Estimate', value: 'estimate' }, + { name: 'Leaf Story Plan Estimate Total', value: 'leafplanest' } ] }) }, @@ -261,7 +262,7 @@ Ext.define('CustomChartApp', { _getChartFetch: function() { var field = this.getSetting('aggregationField'), - fetch = ['FormattedID', 'Name', 'PlanEstimate', field]; + fetch = ['FormattedID', 'Name', 'PlanEstimate', 'LeafStoryPlanEstimateTotal', field]; return fetch; }, diff --git a/deploy/App-external.html b/deploy/App-external.html index eb8514e..921995f 100644 --- a/deploy/App-external.html +++ b/deploy/App-external.html @@ -7,12 +7,12 @@