-
29 Jun 2012 7:47 AM #1
Unanswered: Time based axis not responding to fromDate/toDate
Unanswered: Time based axis not responding to fromDate/toDate
Hey all --
Trying out Touch Charts 2 beta with an ST2 application that I'm building and whenever I try to specify a 'fromDate' and/or 'toDate' in an axis, the values are ignored and I'm left with 1969-January 1970 (which I believe is what happens when you enter a new Date(0)). No matter what I do to update these values, the time type axis is stuck with these two dates.
Here's a sencha fiddle I put together of the issue (NOTE: make sure to hit "Run" to see result): http://www.senchafiddle.com/#CJB2R
And another one using Category as an axis-type: http://www.senchafiddle.com/#FciIX
(Note: In order to make this example work, I had to add touch-charts.js at the beginning of the fiddle - since it doesn't accept 'resources' yet.) My code starts around line 23959, but here's the gist:
Thanks in advance!Code:Ext.define('app.view.chart.Chart', { extend: "Ext.Panel", xtype: 'isochart', requires: [Ext.chart.Chart, Ext.chart.axis.Numeric, Ext.chart.axis.Time, Ext.chart.series.Line], config: { autoDestroy: true, id: 'chartview', layout: 'vbox', defaults: { flex:1, padding:10 }, items: [ { xtype:'chart', store: myStore, style: { background: 'white' }, animate: true, height:300, interactions: [ { type: 'iteminfo', listeners: { show: function(interactions, item, panel){ var storeItem = item.storeItem; console.log(storeItem.get('lmptotal') + ' ' + storeItem.get('date')); } } } ], axes: [{ type: 'Numeric', position:'left', fields: ['lmptotal'], title: 'Price', grid: true, minimum: 0, maximum: 40 }, /* { type: 'Category', position: 'bottom', fields: ['date'], title: 'Hours' } */ { type: 'Time', position:'bottom', fields: 'date', label: { rotate: { degrees: 45 } }, title: 'Hours', dateFormat: 'M Y', grid: true, fromDate: '6/27/12', toDate: '6/28/12' } ], series: [ { type: 'line', highlight: { size:2, radius: 2 }, smooth: false, axis: ['left','bottom'], xField: 'date', yField: 'lmptotal', Title: 'LMP' }] } ]} });
-
3 Jul 2012 6:28 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
- Answers
- 3108
I see you are setting it to a string, have you tried setting it to a Date object?
Side note, we will be having a major overhaul in the next month or two for charts.Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
3 Jul 2012 6:31 AM #3
Thanks for the response @msims84.
I've tried: a.) String (which was the example used in the docs), b.) Date object (new Date('6/27/2012')) and c.) function which returns a date object.
All three seem to have the same result.
-
3 Jul 2012 6:43 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
- Answers
- 3108
Sounds like a bug in the current release.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
3 Jul 2012 7:36 AM #5
Can I use x-credits to get a patch fix for this? Totally understand it's in Beta...
-
3 Jul 2012 8:04 AM #6Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
- Answers
- 3108
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.




Reply With Quote