1

API 2.0 RC1。我可以调用回溯快照存储来返回我想要的记录,但是我无法让计算器正常工作。Lumenize 函数未定义:TypeError: Rally.data.lookback.Lumenize 未定义

我运行查询,按预期工作。但是,我如何“流明”,即整合到一天的粒度,并生成正确的汇总输出?下面的不行,所有的例子都是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();
}
4

1 回答 1

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>
于 2013-07-09T20:21:28.373 回答