API 2.0 RC1. I can call the lookback snapshot store to return the records I want, but then I can't get the calculator to work correctly. The Lumenize functions are undefined: TypeError: Rally.data.lookback.Lumenize is undefined
I run the query, works as expected. But then, how do I "Lumenize", i.e. consolidate to granularity of a day, and generate the correct summary output? The following does not work, and all of the examples are pre-2.0RC1.
//works to get the raw data
Ext.create('Rally.data.lookback.SnapshotStore', {
filters: [
{
property: '_TypeHierarchy',
operator: 'in',
value: ['Defect', 'HierarchicalRequirement']
},
{
property: 'Iteration',
operator: 'in',
value: iteration
},
{
property: '_ValidFrom',
operator: '>=',
value: this.startDate
}
],
autoLoad: true,
fetch: ['Name','FormattedID','ScheduleState','PlanEstimate','Iteration','Release','Project'],
listeners: {
load: {
fn: this._onDataLoaded,
scope: this
}
}
});
//Lumenize not working
_onDataLoaded: function(store, data) {
var config = {
startOn: this.startDate,
endBefore: this.endDate,
tz: 'America/Denver',
workDays:'Monday,Tuesday,Wednesday,Thursday,Friday',
granularity: 'day',
metrics: {"field": "PlanEstimate"},
summaryMetricsConfig: [
{
"field": "PlanEstimate",
"as": "Planned",
"display": "line",
"f": "sum"
},
{
"field": "PlanEstimate",
"as": "Completed",
"f": "filteredSum",
"filterField": "ScheduleState",
"filterValues": "Accepted",
"display": "column"
}
]
};
var calculator = new Rally.data.lookback.Lumenize.TimeSeriesCalculator(config);
var myData = calculator.prepareChartData(store);
var mySummary = calculator.getResults();
}
Unfortunately due to the size of the sdk.js bundle, it was decided not to package the lumenize libs therein. There's an analytics-all.js lib that contains Lumenize, however it doesn't get loaded unless you instantiate a Rally.ui.chart.Chart component.
The easiest thing to do is to explicitly include analytics-all.js after sdk.js:
<script type="text/javascript" src="/apps/2.0rc1/sdk.js"></script>
<script type="text/javascript" src="/apps/2.0rc1/lib/analytics/analytics-all.js"></script>