获取拉力赛中项目累积流程图的所有项目名称

时间:2015-11-06 06:30:01

标签: highcharts rally code-rally

我正在生成一个项目累积流程图,它基于我使用" find获取的项目名称,"但是我无法让它发挥作用。

以下是问题: 1)"发现"在我的代码中只是获取一种项目名称," FE,"但是,我有很多其他项目名称,如FE,BE,VisualRF等。我不知道发生了什么

2)我把它归还给" storeConfig"在图表内部然后我想尝试给出" Name"到" stateFieldName。"这不行!我根本看不到任何图表。

这是代码。

    _chart2: function() {
    var projectName = this.getContext().getProject()._refObjectName;
    console.log("========");
    console.log(projectName);   <<<<<<<<<< This always prints one name'FE' (My project name are FE, BE, etc)
    this.chart = {
            xtype: 'rallychart',
            storeType: 'Rally.data.lookback.SnapshotStore',
            storeConfig: this._getStoreForChart2(),
            calculatorType: 'Rally.example.CFDCalculator',
            calculatorConfig: {
              stateFieldName: this.getContext().getProject()._refObjectName, <<<<< I think usage is not fetching name of all projects 
              stateFieldValues: ['FE','BE','VisualRF']                  
            },
            width: 1000,
            height: 600,
            chartConfig: this._getChart2Config()
        };
    this.chartContainer.add(this.chart);
},


_getStoreForChart2: function() {        
    var obj1 = {
        find: {
            _TypeHierarchy: { '$in' : [ 'Defect' ] },
            Children: null,
            _ProjectHierarchy: this.getContext().getProject().ObjectID,
            _ValidFrom: {'$gt': Rally.util.DateTime.toIsoString(Rally.util.DateTime.add(new Date(), 'day', -30)) },
            State: "Open",
        },
        fetch: ['Severity','Project','ObjectID','FormattedID'],
        hydrate: ['Severity','Project','ObjectID','FormattedID'],
        sort: {
            _ValidFrom: 1
        },
        context: this.getContext().getDataContext(),
        limit: Infinity,
        val: this.Name,
    };
    return obj1;
},

虽然这不重要但是这里是我在上面调用的高图表功能的代码

  _getChart2Config: function() {
    console.log("starting chart config");
    return {
        chart: {
            zoomType: 'xy'
        },
        title: {
            text: 'Chart2'
        },
        xAxis: {
            tickmarkPlacement: 'on',
            tickInterval: 20,
            title: {
                text: 'Date'
            }
        },
        yAxis: [
            {
                title: {
                    text: 'Count'
                }
            }
        ],
        plotOptions: {
            series: {
                marker: {
                    enabled: false
                }
            },
            area: {
                stacking: 'normal'
            }
        }
    };
},

在下面你可以看到&#39; FE&#39;打印: You can see FE bring printed, but my 'Find' returns a lot results. I have to pass them to the stateFieldName so that all the values be used to draw the Project Cumulative Flow Chart

非常感谢! 凯

1 个答案:

答案 0 :(得分:0)

stateFieldName是用于计算CFD的字段 - 通常为ScheduleState或自定义下拉字段,如KanbanState,用于捕获您的进程。 stateFieldValues应该是该字段的值(Defined,In-Progress,Accepted,Completed等)。这根本不涉及项目。绝对记得在你的水合物中包括那个领域并获取。