API 2.0 RC1。我可以调用回顾快照存储来返回我想要的记录,但是我无法让计算器正常工作。 Lumenize函数未定义:TypeError:Rally.data.lookback.Lumenize未定义
我运行查询,按预期工作。但是,我如何“Lumenize”,即巩固到一天的粒度,并生成正确的摘要输出?以下方法不起作用,所有示例均为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();
}
答案 0 :(得分:0)
不幸的是,由于sdk.js包的大小,决定不在其中封装lumenize库。有一个包含Lumenize的analytics-all.js库,但是除非你实例化一个Rally.ui.chart.Chart组件,否则它不会被加载。
最简单的方法是在 sdk.js之后明确包含analytics-all.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>