1. #1
    Sencha User
    Join Date
    Apr 2012
    Location
    Wausau, WI
    Posts
    52
    Vote Rating
    2
    Answers
    2
    Kikketer is on a distinguished road

      0  

    Default 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:
    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')
    }]
    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.

    My code (under the axes array):
    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)
          }
    I discovered that with or without the constrain, from/to dates... I get the exact same graph.

    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

  2. Those should be mared as configs not properties.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,582
    Vote Rating
    433
    Answers
    3101
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    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.

  4. #3
    Sencha User
    Join Date
    Apr 2012
    Location
    Wausau, WI
    Posts
    52
    Vote Rating
    2
    Answers
    2
    Kikketer is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    Those should be mared as configs not properties.
    Ok so in theory my configuration should be working...
    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'],
    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).

    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?

  5. #4
    Sencha User
    Join Date
    Apr 2012
    Location
    Wausau, WI
    Posts
    52
    Vote Rating
    2
    Answers
    2
    Kikketer is on a distinguished road

      0  

    Default


    Well now that I actually looked at the Ext.Date documentation, WEEK doesn't exist. Sorry for wasting your time, I found that
    Code:
    step : [Ext.Date.DAY, 7]
    Worked like a champ!