lookbackapi - Resticting a Rally chart snapshot store to a date period -
lookbackapi - Resticting a Rally chart snapshot store to a date period -
i want show info rally using snapshot sotre passed teh chart this:
storeconfig: { find: { _itemhierarchy: 15312401235, //pi object id //release: 9045474054, _typehierarchy: 'hierarchicalrequirement', //burn on stories children: null, //only include leaf stories, _validto: { $gte: me._startdatefield.value }, _validfrom: { $lte: me._enddatefield.value } }, fetch: ['schedulestate', 'planestimate'], hydrate: ['schedulestate'], sort: { '_validfrom': 1 } } the thought want chart show yhe period between start date , end date specified in me._startdatefield.value , me._enddatefield.value. way of achieving this? because chart displays info starting jan , not start date.
this example restricts end date selection in sec rallydatepicker instead of defaulting today's date. see readme here.
ext.define('customapp', { extend: 'rally.app.app', componentcls: 'app', launch: function() { var = this; var mindate = new date(new date() - 86400000*90); //milliseconds in day = 86400000 var datepicker = ext.create('ext.panel.panel', { title: 'choose start , end dates:', bodypadding: 10, renderto: ext.getbody(), layout: 'hbox', items: [{ xtype: 'rallydatepicker', itemid: 'from', mindate: mindate, handler: function(picker, date) { that.onstartdateselected(date); } }, { xtype: 'rallydatepicker', itemid: 'to', mindate: mindate, handler: function(picker, date) { that.onenddateselected(date); } }] }); this.add(datepicker); var panel = ext.create('ext.panel.panel', { id:'infopanel', componentcls: 'panel' }); this.add(panel); }, onstartdateselected:function(date){ console.log(date); this._startdate = date; }, onenddateselected:function(date){ this._enddate = date; console.log(date); ext.getcmp('infopanel').update('showing info between ' + this._startdate + ' , ' + this._enddate); this.definecalculator(); this.makechart(); }, definecalculator: function(){ var = this; ext.define("mydefectcalculator", { extend: "rally.data.lookback.calculator.timeseriescalculator", getmetrics: function () { var metrics = [ { field: "state", as: "open", display: "column", f: "filteredcount", filterfield: "state", filtervalues: ["submitted","open"] }, { field: "state", as: "closed", display: "column", f: "filteredcount", filterfield: "state", filtervalues: ["fixed","closed"] } ]; homecoming metrics; } }); }, makechart: function(){ if (this.down('#mychart')) { this.remove('mychart'); } var timeperiod = new date(this._enddate - this._startdate); var project = this.getcontext().getproject().objectid; var storeconfig = this.createstoreconfig(project, timeperiod); this.chartconfig.calculatorconfig.startdate = rally.util.datetime.format(new date(this._startdate), 'y-m-d'); this.chartconfig.calculatorconfig.enddate = rally.util.datetime.format(new date(this._enddate), 'y-m-d'); this.chartconfig.storeconfig = storeconfig; this.add(this.chartconfig); }, createstoreconfig : function(project, interval ) { homecoming { listeners : { load : function(store,data) { console.log("data",data.length); } }, filters: [ { property: '_projecthierarchy', operator : 'in', value : [project] }, { property: '_typehierarchy', operator: 'in', value: ['defect'] }, { property: '_validfrom', operator: '>=', value: interval } ], autoload : true, limit: infinity, fetch: ['state'], hydrate: ['state'] }; }, chartconfig: { xtype: 'rallychart', itemid : 'mychart', chartcolors: ['red', 'green'], storeconfig: { }, calculatortype: 'mydefectcalculator', calculatorconfig: { }, chartconfig: { plotoptions: { column: { stacking: 'normal'} }, chart: { }, title: { text: 'open/closed defects'}, xaxis: { tickinterval: 1, labels: { formatter: function() { var d = new date(this.value); homecoming ""+(d.getmonth()+1)+"/"+d.getdate(); } }, title: { text: 'date' } }, yaxis: [ { title: { text: 'count' } } ] } } }); rally lookbackapi
Comments
Post a Comment