1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    2
    Vote Rating
    0
    aseitler is on a distinguished road

      0  

    Default Unanswered: Chart Time Axis not scaling correctly

    Unanswered: Chart Time Axis not scaling correctly


    I've been working with the charting library for a while now trying to figure out how to get the time axis to scale with the marks at the 1st of each month. The following is the code for my time axis:

    Code:
    {
         type: 'Time',
         position: 'bottom',
         fields: ['date'],
         dateFormat: 'M \'y',
         groupBy: 'year, month',
         step: [Ext.Date.MONTH, 1],
    
    
         fromDate: minDate,
         toDate: maxDate
     }
    where minDate is the first day of the month a year ago and max date is the first of the next month from the current date. I thought the step property would guarantee that it would step from, say March 1st to April 1st to May 1st, etc. Any thoughts on this would be appreciated!

    Also, the time is stored as a numerical timestamp if that has any bearing on an answer.

    I'm using ExtJS 4.0.7

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,347
    Answers
    3542
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    To be honest, I have had issues with the time axis in 4.x
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jun 2011
    Posts
    2
    Vote Rating
    0
    aseitler is on a distinguished road

      0  

    Default


    What sort of problems have you had and have you found a solution? I really need to get this to work and I'm not finding any way around it. I'm pretty sure I know exactly why the scaling is off based on what the time axis code is trying to do, but I don't know a workaround.

  4. #4
    Sencha User
    Join Date
    Apr 2012
    Posts
    10
    Vote Rating
    0
    bluezz is on a distinguished road

      0  

    Default


    I would love to know if there's a work around for this too.
    Most of the charts have time as one of their axis so this bug makes extjs charts pretty unusable!

  5. #5
    Ext JS Premium Member Charlyva's Avatar
    Join Date
    Dec 2007
    Location
    Austria, St. Pölten
    Posts
    88
    Vote Rating
    0
    Charlyva is on a distinguished road

      0  

    Post Time Axis - monthly (yearly) steps

    Time Axis - monthly (yearly) steps


    I would love to use time axis too, but this bug is kind of a dealbreaker for using the extjs charts. Almost EVERY chart hast a time component, very often scaled in monthly or yearly steps. Looks like the time axis cannot deal with the various length of different months. For the moment it seems the only choice is to switch to the highcharts library for the time being.

    Please, please get things straight with the time axis. I would rather go with an homogen extjs solution than mix various js-frameworks.

    thanks in advance.
    Mike
    strangers are friends i haven't met yet

  6. #6
    Sencha User
    Join Date
    Aug 2011
    Location
    Bangalore,IN
    Posts
    114
    Answers
    6
    Vote Rating
    0
    gameboy87 is on a distinguished road

      0  

    Default


    May I know how you took the minDate and maxDate ? I was able to pick up the values from inside the store's load event. But outside the store I was not able to do it. Please help on this.


    Quote Originally Posted by aseitler View Post
    I've been working with the charting library for a while now trying to figure out how to get the time axis to scale with the marks at the 1st of each month. The following is the code for my time axis:

    Code:
    {
         type: 'Time',
         position: 'bottom',
         fields: ['date'],
         dateFormat: 'M \'y',
         groupBy: 'year, month',
         step: [Ext.Date.MONTH, 1],
    
    
         fromDate: minDate,
         toDate: maxDate
     }
    where minDate is the first day of the month a year ago and max date is the first of the next month from the current date. I thought the step property would guarantee that it would step from, say March 1st to April 1st to May 1st, etc. Any thoughts on this would be appreciated!

    Also, the time is stored as a numerical timestamp if that has any bearing on an answer.

    I'm using ExtJS 4.0.7