指定“从"到“时间"在 Rally 中下拉日历以获取图表 [英] specifying "From" to "Time" drop down calendar in Rally for a chart

查看:38
本文介绍了指定“从"到“时间"在 Rally 中下拉日历以获取图表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个有效的项目累积流"图表.它目前从 Rally 中提取过去 3 个月的数据并在图表中正确显示.但是,现在我想提供From"和To"下拉日历,以便用户可以将日期范围更改为他想要的.因此,默认情况下,用户将显示 3 个月,并且图表的一侧不应该有一个从"和到"下拉日历,供用户根据需要更改范围.我参与了这项工作.我添加了日期格式化程序,但无法提取用户在该字段中选择的值,然后刷新我的图表.可以请帮我到这里吗?多谢.

I have a "Project cumulative flow" chart that is working. It currently pulls data for last 3 months from Rally and displays it correctly in the chart. However, now I want to provide the a "From" and "To" drop down calendar, so that user can change the range of dates to what he wants. So, by default the user will be shown 3 months and no the side of the chart there should be a "From" and "To" drop down calendar for user to change the range if he wishes to. I have a part of this working. I have added the date format-er, but am not able to extract the values selected by user in that field, and then refresh my Chart. Can please help get me here? thanks a lot.

    /*
 * 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);
},

这是目前的屏幕截图:

推荐答案

图表组件无法刷新 - 您必须销毁它并重新添加一个新的,并使用以下日期填充数据您的日期字段.

The chart component does not have a way to refresh- you'll have to destroy it and re-add a new one, with data populated using the dates from your date fields.

这篇关于指定“从"到“时间"在 Rally 中下拉日历以获取图表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆