-
13 Apr 2012 8:45 AM #1
Answered: How to set properties?
Answered: How to set properties?
So this may be a dumb question, but how do we use Properties as opposed to Config options?
From the example located in the Time documentation
http://docs.sencha.com/touch-charts/...hart.axis.Time
we have this:
Notice how "constrain" exists, along with the from/to date properties. In the documentation these three are "Properties" and not "Config" options. I've attempted to do this same thing in my code and found that anything that's a Property doesn't seem to work this way.Code:axes: [{ type: 'Time', position: 'bottom', fields: 'date', title: 'Day', dateFormat: 'M d', groupBy: 'year,month,day', aggregateOp: 'sum', constrain: true, fromDate: new Date('1/1/11'), toDate: new Date('1/7/11') }]
My code (under the axes array):
I discovered that with or without the constrain, from/to dates... I get the exact same graph.Code:{ type : 'Time', position : 'bottom', fields : ['date'], title : 'Date', dateFormat : "m-d", label : { rotate : { degrees : 300 } }, constrain : true, fromDate : new Date(2010, 11, 11), toDate : new Date(2011, 11, 11) }
Is there a different way to use Properties compared to Config options?Last edited by Kikketer; 13 Apr 2012 at 8:47 AM. Reason: Fixed up the copy/paste from the documentation
-
Best Answer Posted by mitchellsimoens
Those should be mared as configs not properties.
-
13 Apr 2012 9:46 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 433
- Answers
- 3101
Those should be mared as configs not properties.
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.
-
13 Apr 2012 10:11 AM #3
Ok so in theory my configuration should be working...
Exists in my model, it converts everything to a date string. The all the other config options I've set in the chart seem to work (including dateFormat).Code:fields : [ { name : 'date', convert : function(value, record) { // Convert the m-d-YYYY to javascript's date return Ext.Date.parse(value, "n-j-Y"); } }, 'i', 'a'],
My graph looks incredibly cluttered on the lower axis because I can't seem to find a way to reduce the number of labels. step : [Ext.Date.WEEK, 1] didn't seem to work.
Any clue why the constrain isn't working?
-
13 Apr 2012 10:16 AM #4
Well now that I actually looked at the Ext.Date documentation, WEEK doesn't exist.
Sorry for wasting your time, I found that
Worked like a champ!Code:step : [Ext.Date.DAY, 7]


Reply With Quote