-
Notifications
You must be signed in to change notification settings - Fork 22
/
Calculator.js
44 lines (37 loc) · 1.1 KB
/
Calculator.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Ext.define('Calculator', {
config: {
bucketBy: 'release',
aggregateBy: 'count'
},
constructor: function (config) {
this.initConfig(config);
},
prepareChartData: function (store) {
var groupedData = this._groupData(store.getRange()),
categories = this._getCategories(groupedData),
seriesData = this._getSeriesData(groupedData);
return {
categories: categories,
series: [
{
name: 'Feature Throughput',
type: 'column',
data: seriesData
}
]
};
},
_groupData: function (records) {
//group the data into buckets by release name
//hint: _.groupBy
},
_getCategories: function(groupedData) {
//get the list of release names
//hint: _.keys
},
_getSeriesData: function(groupedData) {
//compute the total in each bucket
//example: [['Release 1', 50], ['Release 2', 35]]
//hint: _.map
}
});