指定"来自"到"时间"在拉力赛中下拉日历以获取图表

时间:2015-11-16 20:00:54

标签: rally

我有一个"项目累积流量"工作的图表。它目前从Rally中提取最近3个月的数据并在图表中正确显示。但是,现在我想提供一个" From"和" To"下拉日历,以便用户可以将日期范围更改为他想要的日期。因此,默认情况下,用户将显示3个月,并且图表的旁边不应该有" From"和" To"下拉日历以供用户根据需要更改范围。我有一部分工作。我添加了日期格式-er,但无法在该字段中提取用户选择的值,然后刷新我的图表。请帮忙把我带到这里?非常感谢。

    /*
 * Load 8.2 open Defect trend
 * */
_82openDefect: function() {
    this.chart = {
            xtype: 'rallychart',
            storeType: 'Rally.data.lookback.SnapshotStore',
            storeConfig: this._82getStoreForopenDefect(),
            calculatorType: 'Rally.example.CFDCalculator',
            calculatorConfig: {
                  stateFieldName: 'Severity',
                  stateFieldValues: ['P1 - Crash/Data Loss, upgrade/migration fail', 
                                     'P2 - Major Problem, loss of stability or feature functionality', 
                                     'P3 - Minor Problem, improves customer experience',
                                     'P4 - Cosmetic, okay to defer'
                                     ]
            },
            width: 1000,
            height: 600,
            chartConfig: this._82getopenDefectConfig()
        };
    this.chartContainer.add(this.chart);
    this._releaseContainer();
    this._dateFormat();
},

_82getStoreForopenDefect: function() {
    return {
        find: {
            _TypeHierarchy: { '$in' : [ 'Defect' ] },
            Children: null,
            _ProjectHierarchy: this.getContext().getProject().ObjectID,
            _ValidFrom: {'$gt': Rally.util.DateTime.toIsoString(Rally.util.DateTime.add(new Date(), 'day', -120)) },
            State: "Open",
            //Release: 19388025787 is for 8.2
            Release: 19388025787,
            //Severity: "P1 - Crash/Data Loss, upgrade/migration fail",
        },
        fetch: ['Severity','Release','Project','SubmittedBy','Name'],
        hydrate: ['Severity','Release','Project','SubmittedBy','Name'],
        sort: {
            _ValidFrom: 1
        },
        context: this.getContext().getDataContext(),
        limit: Infinity
    };
},

_82getopenDefectConfig: function() {
    console.log("starting 8.2 open defect chart");
    return {
        chart: {
            zoomType: 'xy'
        },
        title: {
            text: '8.2 Open Defects'
        },
        xAxis: {
            tickmarkPlacement: 'on',
            tickInterval: 20,
            title: {
                text: 'Date'
            }
        },
        yAxis: [
            {
                title: {
                    text: 'Count'
                }
            }
        ],
        plotOptions: {
            series: {
                marker: {
                    enabled: false
                }
            },
            area: {
                stacking: 'normal'
            }
        }
    };
},
_dateFormat: function() {
    this.dateFrmt = Ext.create('Ext.form.Panel', {
        renderTo: Ext.getBody(),
        width: 300,
        bodyPadding: 10,
        title: 'Dates',
        items: [{
            xtype: 'datefield',
            anchor: '100%',
            fieldLabel: 'Date',
            name: 'date',
            // The value matches the format; will be parsed and displayed using that format.
            format: 'm d Y',
            value: '2 4 1978'
        }, {
            xtype: 'datefield',
            anchor: '100%',
            fieldLabel: 'Date',
            name: 'date',
            // The value does not match the format, but does match an altFormat; will be parsed
            // using the altFormat and displayed using the format.
            format: 'm d Y',
            altFormats: 'm,d,Y|m.d.Y',
            value: '2.4.1978'
        }]
    });
    this.chartContainer.add(this.dateFrmt);
},
      _releaseContainer: function () {
    this.relContainer = Ext.create('Ext.Container', {
    items: [{
        xtype: 'rallyreleasecombobox',
    }],
    listeners: function(releasecombobox) {
        ready: this._loadReleaseChart(this.relContainer.getValue());
       select: this._loadReleaseChart("8.1");
        scope: this
    }     
    });
    //console.log(this.relContainer.getValue());
    this.chartContainer.add(this.relContainer);
},

这是目前看起来像的屏幕截图: enter image description here

1 个答案:

答案 0 :(得分:0)

图表组件没有办法刷新 - 您必须销毁它并重新添加新数据,并使用日期字段中的日期填充数据。