You found a bug! We've classified it as CHARTS-197 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Ext JS Premium Member
    Join Date
    Mar 2010
    Posts
    227
    Vote Rating
    2
    alphadogg is on a distinguished road

      0  

    Default Time x-axis and getFullYear() error

    Time x-axis and getFullYear() error


    REQUIRED INFORMATION


    Ext version tested:
    • Ext 4.0.5

    Browser versions tested against:
    • IE9
    • FF5

    Description:
    • SCRIPT5007: Unable to get value of the property 'getFullYear': object is null or undefined ext-all-debug.js, line 45504 character 13

    Steps to reproduce the problem:
    • Use script excerpt below

    The result that was expected:
    • A visible chart

    The result that occurs instead:
    • An invisible chart

    Test Case:

    Code:
    <html>
    <head>
      <link rel="stylesheet" type="text/css" href="/css/extjs.4.0.5/ext-all-gray-localized.css" />
    
      <!-- extjs -->
      <script type="text/javascript" src="/scripts/extjs.4.0.5/bootstrap.js"></script>
    
      <!-- grid -->
      <script language=JavaScript>
      Ext.onReady(function() {
    
        Ext.BLANK_IMAGE_URL = '/images/extjs.4.0.5/s.gif';
        Ext.tip.QuickTipManager.init();
         
        Ext.define('OpenCloseModel', {
          extend: 'Ext.data.Model',
          fields: [
            {name: 'Key', type: 'date', dateFormat: 'Y/m'},
            {name: 'DollarsOpened', type: 'float'},
            {name: 'DollarsClosed', type: 'float'},
            {name: 'LinesOpened', type: 'float'},
            {name: 'LinesClosed', type: 'float'},
            {name: 'InvoicesOpened', type: 'float'},
            {name: 'InvoicesClosed', type: 'float'}
          ]
        });
        
        var store = Ext.create('Ext.data.Store', {
          storeId: 'OpenCloseStore',
          model: 'OpenCloseModel',
          data: [
            {"Key":"2005/08","DollarsOpened":"1097.5","DollarsClosed":"0","LinesOpened":"36","LinesClosed":"15","InvoicesOpened":"23","InvoicesClosed":"14"},
            {"Key":"2005/09","DollarsOpened":"5120.94","DollarsClosed":"0","LinesOpened":"208","LinesClosed":"94","InvoicesOpened":"175","InvoicesClosed":"81"},
            {"Key":"2005/10","DollarsOpened":"6245.68","DollarsClosed":"0","LinesOpened":"269","LinesClosed":"136","InvoicesOpened":"226","InvoicesClosed":"122"},
            {"Key":"2005/11","DollarsOpened":"5338.66","DollarsClosed":"0","LinesOpened":"243","LinesClosed":"117","InvoicesOpened":"205","InvoicesClosed":"105"},
            {"Key":"2005/12","DollarsOpened":"6291.32","DollarsClosed":"0","LinesOpened":"224","LinesClosed":"116","InvoicesOpened":"202","InvoicesClosed":"105"},
            {"Key":"2006/01","DollarsOpened":"3600.1","DollarsClosed":"0","LinesOpened":"225","LinesClosed":"120","InvoicesOpened":"188","InvoicesClosed":"107"},
            {"Key":"2006/02","DollarsOpened":"4452.18","DollarsClosed":"0","LinesOpened":"201","LinesClosed":"134","InvoicesOpened":"168","InvoicesClosed":"112"},
            {"Key":"2006/03","DollarsOpened":"1692.82","DollarsClosed":"0","LinesOpened":"144","LinesClosed":"100","InvoicesOpened":"121","InvoicesClosed":"85"},
            {"Key":"2006/04","DollarsOpened":"1117.88","DollarsClosed":"0","LinesOpened":"139","LinesClosed":"102","InvoicesOpened":"109","InvoicesClosed":"79"},
            {"Key":"2006/05","DollarsOpened":"1643.28","DollarsClosed":"0","LinesOpened":"153","LinesClosed":"113","InvoicesOpened":"117","InvoicesClosed":"89"},
            {"Key":"2006/06","DollarsOpened":"3981.67","DollarsClosed":"0","LinesOpened":"180","LinesClosed":"123","InvoicesOpened":"140","InvoicesClosed":"96"},
            {"Key":"2006/07","DollarsOpened":"4269.79","DollarsClosed":"0","LinesOpened":"163","LinesClosed":"108","InvoicesOpened":"136","InvoicesClosed":"88"},
            {"Key":"2006/08","DollarsOpened":"1929.55","DollarsClosed":"0","LinesOpened":"140","LinesClosed":"90","InvoicesOpened":"112","InvoicesClosed":"73"},
            {"Key":"2006/09","DollarsOpened":"9029.83","DollarsClosed":"0","LinesOpened":"289","LinesClosed":"178","InvoicesOpened":"234","InvoicesClosed":"139"},
            {"Key":"2006/10","DollarsOpened":"2408.25","DollarsClosed":"0","LinesOpened":"161","LinesClosed":"108","InvoicesOpened":"130","InvoicesClosed":"88"},
            {"Key":"2006/11","DollarsOpened":"3380.23","DollarsClosed":"0","LinesOpened":"127","LinesClosed":"90","InvoicesOpened":"107","InvoicesClosed":"74"},
            {"Key":"2006/12","DollarsOpened":"2971.23","DollarsClosed":"0","LinesOpened":"128","LinesClosed":"76","InvoicesOpened":"108","InvoicesClosed":"69"},
            {"Key":"2007/01","DollarsOpened":"2581.34","DollarsClosed":"0","LinesOpened":"151","LinesClosed":"84","InvoicesOpened":"137","InvoicesClosed":"81"},
            {"Key":"2007/02","DollarsOpened":"2338.18","DollarsClosed":"0","LinesOpened":"135","LinesClosed":"91","InvoicesOpened":"112","InvoicesClosed":"78"},
            {"Key":"2007/03","DollarsOpened":"4033.34","DollarsClosed":"0","LinesOpened":"127","LinesClosed":"100","InvoicesOpened":"103","InvoicesClosed":"81"},
            {"Key":"2007/04","DollarsOpened":"2256.15","DollarsClosed":"0","LinesOpened":"96","LinesClosed":"76","InvoicesOpened":"83","InvoicesClosed":"66"},
            {"Key":"2007/05","DollarsOpened":"1934.93","DollarsClosed":"0","LinesOpened":"83","LinesClosed":"62","InvoicesOpened":"73","InvoicesClosed":"57"},
            {"Key":"2007/06","DollarsOpened":"2582","DollarsClosed":"0","LinesOpened":"87","LinesClosed":"59","InvoicesOpened":"72","InvoicesClosed":"54"},
            {"Key":"2007/07","DollarsOpened":"4244.91","DollarsClosed":"0","LinesOpened":"93","LinesClosed":"64","InvoicesOpened":"78","InvoicesClosed":"56"},
            {"Key":"2007/08","DollarsOpened":"5160.99","DollarsClosed":"0","LinesOpened":"91","LinesClosed":"56","InvoicesOpened":"70","InvoicesClosed":"44"},
            {"Key":"2007/09","DollarsOpened":"3434.95","DollarsClosed":"0","LinesOpened":"85","LinesClosed":"55","InvoicesOpened":"66","InvoicesClosed":"46"},
            {"Key":"2007/10","DollarsOpened":"3823.84","DollarsClosed":"0","LinesOpened":"71","LinesClosed":"35","InvoicesOpened":"62","InvoicesClosed":"32"},
            {"Key":"2007/11","DollarsOpened":"3030.02","DollarsClosed":"-339.52","LinesOpened":"127","LinesClosed":"95","InvoicesOpened":"114","InvoicesClosed":"83"},
            {"Key":"2007/12","DollarsOpened":"1643.77","DollarsClosed":"-339.52","LinesOpened":"137","LinesClosed":"113","InvoicesOpened":"125","InvoicesClosed":"103"},
            {"Key":"2008/01","DollarsOpened":"2767.91","DollarsClosed":"-362.21","LinesOpened":"211","LinesClosed":"165","InvoicesOpened":"182","InvoicesClosed":"141"},
            {"Key":"2008/02","DollarsOpened":"1454.15","DollarsClosed":"-339.52","LinesOpened":"165","LinesClosed":"144","InvoicesOpened":"136","InvoicesClosed":"120"},
            {"Key":"2008/03","DollarsOpened":"1100.72","DollarsClosed":"-380.62","LinesOpened":"164","LinesClosed":"146","InvoicesOpened":"137","InvoicesClosed":"121"},
            {"Key":"2008/04","DollarsOpened":"1128.24","DollarsClosed":"-491.22","LinesOpened":"195","LinesClosed":"172","InvoicesOpened":"172","InvoicesClosed":"154"},
            {"Key":"2008/05","DollarsOpened":"1334.58","DollarsClosed":"-52.98","LinesOpened":"146","LinesClosed":"125","InvoicesOpened":"115","InvoicesClosed":"97"},
            {"Key":"2008/06","DollarsOpened":"2030.43","DollarsClosed":"-95.8","LinesOpened":"199","LinesClosed":"168","InvoicesOpened":"170","InvoicesClosed":"144"},
            {"Key":"2008/07","DollarsOpened":"1839.67","DollarsClosed":"-182.96","LinesOpened":"141","LinesClosed":"117","InvoicesOpened":"110","InvoicesClosed":"89"},
            {"Key":"2008/08","DollarsOpened":"10161.75","DollarsClosed":"0","LinesOpened":"138","LinesClosed":"111","InvoicesOpened":"111","InvoicesClosed":"88"},
            {"Key":"2008/09","DollarsOpened":"1680.49","DollarsClosed":"0","LinesOpened":"144","LinesClosed":"114","InvoicesOpened":"130","InvoicesClosed":"103"},
            {"Key":"2008/10","DollarsOpened":"3829.71","DollarsClosed":"0","LinesOpened":"139","LinesClosed":"104","InvoicesOpened":"113","InvoicesClosed":"84"},
            {"Key":"2008/11","DollarsOpened":"41097.29","DollarsClosed":"0","LinesOpened":"134","LinesClosed":"87","InvoicesOpened":"108","InvoicesClosed":"70"},
            {"Key":"2008/12","DollarsOpened":"2266.88","DollarsClosed":"0","LinesOpened":"134","LinesClosed":"91","InvoicesOpened":"110","InvoicesClosed":"70"},
            {"Key":"2009/01","DollarsOpened":"2446.68","DollarsClosed":"-71.29","LinesOpened":"200","LinesClosed":"155","InvoicesOpened":"154","InvoicesClosed":"122"},
            {"Key":"2009/02","DollarsOpened":"5291.57","DollarsClosed":"0","LinesOpened":"157","LinesClosed":"97","InvoicesOpened":"127","InvoicesClosed":"78"},
            {"Key":"2009/03","DollarsOpened":"2576.86","DollarsClosed":"0","LinesOpened":"145","LinesClosed":"104","InvoicesOpened":"126","InvoicesClosed":"93"},
            {"Key":"2009/04","DollarsOpened":"3502.76","DollarsClosed":"0","LinesOpened":"140","LinesClosed":"97","InvoicesOpened":"112","InvoicesClosed":"80"},
            {"Key":"2009/05","DollarsOpened":"6412.51","DollarsClosed":"0","LinesOpened":"160","LinesClosed":"110","InvoicesOpened":"130","InvoicesClosed":"96"},
            {"Key":"2009/06","DollarsOpened":"6315.25","DollarsClosed":"0","LinesOpened":"158","LinesClosed":"114","InvoicesOpened":"132","InvoicesClosed":"97"},
            {"Key":"2009/07","DollarsOpened":"7353.92","DollarsClosed":"-28.08","LinesOpened":"190","LinesClosed":"138","InvoicesOpened":"158","InvoicesClosed":"123"},
            {"Key":"2009/08","DollarsOpened":"3501.74","DollarsClosed":"-38.48","LinesOpened":"219","LinesClosed":"167","InvoicesOpened":"186","InvoicesClosed":"147"},
            {"Key":"2009/09","DollarsOpened":"6138.45","DollarsClosed":"-1798.81","LinesOpened":"301","LinesClosed":"210","InvoicesOpened":"236","InvoicesClosed":"180"},
            {"Key":"2009/10","DollarsOpened":"6338.24","DollarsClosed":"-122.4","LinesOpened":"461","LinesClosed":"271","InvoicesOpened":"377","InvoicesClosed":"228"},
            {"Key":"2009/11","DollarsOpened":"7715.41","DollarsClosed":"-3","LinesOpened":"406","LinesClosed":"266","InvoicesOpened":"317","InvoicesClosed":"211"},
            {"Key":"2009/12","DollarsOpened":"5258.23","DollarsClosed":"0","LinesOpened":"386","LinesClosed":"252","InvoicesOpened":"293","InvoicesClosed":"207"},
            {"Key":"2010/01","DollarsOpened":"2857.06","DollarsClosed":"0","LinesOpened":"367","LinesClosed":"304","InvoicesOpened":"289","InvoicesClosed":"253"},
            {"Key":"2010/02","DollarsOpened":"2663.86","DollarsClosed":"0","LinesOpened":"324","LinesClosed":"273","InvoicesOpened":"245","InvoicesClosed":"219"},
            {"Key":"2010/03","DollarsOpened":"3831.92","DollarsClosed":"0","LinesOpened":"267","LinesClosed":"220","InvoicesOpened":"205","InvoicesClosed":"174"},
            {"Key":"2010/04","DollarsOpened":"1346.46","DollarsClosed":"-1246.07","LinesOpened":"257","LinesClosed":"215","InvoicesOpened":"200","InvoicesClosed":"171"},
            {"Key":"2010/05","DollarsOpened":"1664.63","DollarsClosed":"0","LinesOpened":"219","LinesClosed":"185","InvoicesOpened":"177","InvoicesClosed":"152"},
            {"Key":"2010/06","DollarsOpened":"2692.79","DollarsClosed":"0","LinesOpened":"267","LinesClosed":"229","InvoicesOpened":"203","InvoicesClosed":"180"},
            {"Key":"2010/07","DollarsOpened":"1833.62","DollarsClosed":"0","LinesOpened":"301","LinesClosed":"267","InvoicesOpened":"230","InvoicesClosed":"208"},
            {"Key":"2010/08","DollarsOpened":"8868.25","DollarsClosed":"0","LinesOpened":"267","LinesClosed":"230","InvoicesOpened":"204","InvoicesClosed":"179"},
            {"Key":"2010/09","DollarsOpened":"3155.66","DollarsClosed":"0","LinesOpened":"281","LinesClosed":"238","InvoicesOpened":"224","InvoicesClosed":"189"},
            {"Key":"2010/10","DollarsOpened":"1484.97","DollarsClosed":"0","LinesOpened":"282","LinesClosed":"242","InvoicesOpened":"228","InvoicesClosed":"198"},
            {"Key":"2010/11","DollarsOpened":"1652.68","DollarsClosed":"0","LinesOpened":"309","LinesClosed":"274","InvoicesOpened":"255","InvoicesClosed":"231"},
            {"Key":"2010/12","DollarsOpened":"1317.42","DollarsClosed":"-62.85","LinesOpened":"432","LinesClosed":"400","InvoicesOpened":"333","InvoicesClosed":"310"},
            {"Key":"2011/01","DollarsOpened":"3335.93","DollarsClosed":"-97.5","LinesOpened":"535","LinesClosed":"462","InvoicesOpened":"390","InvoicesClosed":"337"},
            {"Key":"2011/02","DollarsOpened":"5808.32","DollarsClosed":"0","LinesOpened":"508","LinesClosed":"423","InvoicesOpened":"332","InvoicesClosed":"284"},
            {"Key":"2011/03","DollarsOpened":"8122.25","DollarsClosed":"-11.9","LinesOpened":"384","LinesClosed":"278","InvoicesOpened":"292","InvoicesClosed":"214"},
            {"Key":"2011/04","DollarsOpened":"13445.92","DollarsClosed":"0","LinesOpened":"533","LinesClosed":"280","InvoicesOpened":"396","InvoicesClosed":"214"},
            {"Key":"2011/05","DollarsOpened":"17946.83","DollarsClosed":"0","LinesOpened":"448","LinesClosed":"103","InvoicesOpened":"321","InvoicesClosed":"81"},
            {"Key":"2011/06","DollarsOpened":"12108.83","DollarsClosed":"0","LinesOpened":"195","LinesClosed":"18","InvoicesOpened":"146","InvoicesClosed":"14"},
            {"Key":"2011/07","DollarsOpened":"123","DollarsClosed":"0","LinesOpened":"1","LinesClosed":"0","InvoicesOpened":"0","InvoicesClosed":"0"},
            {"Key":"2011/08","DollarsOpened":"500","DollarsClosed":"0","LinesOpened":"1","LinesClosed":"0","InvoicesOpened":"1","InvoicesClosed":"0"}
          ]
        });
        
        Ext.create('Ext.chart.Chart', {
            renderTo: 'theChart',
            store: store,
            width: 800,
            height: 600,
            animate: true,
            shadow: false,
            theme: 'Base',
            legend: {
                position: 'right'
            },
            axes: [
              {   type: 'Time',
                  position: 'bottom',
                  fields: ['Key'],
                  title: 'Time',
                  grid: true,
                  dateFormat: 'Y m',
                  groupBy: 'year,month,day',
                  aggregateOp: 'sum',
                  constrain: true,
                  fromDate: new Date('1/1/2000'),
                  toDate: new Date('12/31/2020')
              }
              /*{   type: 'Category',
                  position: 'bottom',
                  fields: ['Key'],
                  title: 'Time',
                  grid: true
              }*/
              ,{  type: 'Numeric',
                  position: 'left',
                  fields: ['DollarsOpened', 'DollarsClosed'],
                  title: 'Dollars ($)',
                  minorTickSteps: 4,
                  grid: {
                      even: {
                          opacity: 1,
                          fill: '#ddd',
                          stroke: '#bbb',
                          'stroke-width': 0.5
                      }
                  }
              }
            ],
            series: [
              {
                type: 'line',
                highlight: {
                  size: 5,
                  radius: 5
                },
                axis: 'left',
                xField: 'Key',
                yField: 'DollarsOpened',
                markerConfig: {
                  type: 'circle',
                  size: 3,
                  radius: 3,
                  'stroke-width': 0
                }
              },
              {
                type: 'line',
                highlight: {
                  size: 5,
                  radius: 5
                },
                axis: 'left',
                xField: 'Key',
                yField: 'DollarsClosed',
                markerConfig: {
                  type: 'circle',
                  size: 3,
                  radius: 3,
                  'stroke-width': 0
                }
              }
            ]
        });
        
      });
        
      </script>
    </head>
    <body>
    <div id="theChart" width="100%"></div>
    </body>
    </html>


    HELPFUL INFORMATION


    Screenshot or Video:
    • n/a

    Debugging already done:
    • none

    Possible fix:
    • unknown to me. that's why I'm asking

    Additional CSS used:
    • gray theme

    Operating System:
    • Windows 7

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

      0  

    Exclamation Ext.Date.getFullYear() does not exist? (ExtJS 4.0.2a)

    Ext.Date.getFullYear() does not exist? (ExtJS 4.0.2a)


    hi,

    The API doc for ExtJS 4.0.2a does not include any info about getFullYear(), nor can I find the function definition (ext-debug.js, ext-all-debug.js). I found this by calling getWeekOfYear() which relies on getFullYear():

    TypeError: Result of expression 'date.getFullYear' [undefined] is not a function.


    tim

Thread Participants: 1