Results 1 to 10 of 10

Thread: [CMD+ExtJS] Problem with Charts only in build

  1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    185
    Answers
    6

    Default [CMD+ExtJS] Problem with Charts only in build

    Hello!

    I'm having some trouble with Charts only in build, in dev works fine with no errors.

    This is the error that console returns:
    Code:
    Uncaught TypeError: Cannot read property 'length' of undefined

    This is the Chart view:
    Code:
    Ext.define("MyApp.view.Chart", {
        extend: 'Ext.chart.Chart',
    
    
        xtype: 'mychart',
        layout: 'fit',
    
    
        style: 'background:#fff',
        animate: true,
        shadow: true,
        requires : [
            'MyApp.store.ChartStore'
        ],
    
    
        store: {
          type: 'mystore'
        },
        axes: [{
          type: 'Numeric',
          position: 'left',
          fields: ['number'],
          // label: {
          //     // renderer: Ext.util.Format.numberRenderer('0.0')
          // },
          title: 'Vel',
          grid: true,
          minimum: 0
        }, {
          type: 'Category',
          position: 'bottom',
          fields: ['data']
          // title: 'Data'
        }],
        series: [
          {
            type: 'column',
            axis: 'left',
            highlight: true,
            tips: {
              trackMouse: true,
              width: 160,
              height: 28,
              renderer: function(storeItem, item) {
                this.setTitle(storeItem.get('data') + ': ' + storeItem.get('number'));
              }
            },
            renderer: function(sprite, storeItem, barAttr, i, store) {
              barAttr.fill = '#225885';
              return barAttr;
            },
            label: {
              display: 'insideEnd',
              'text-anchor': 'middle',
              font: '1em bold arial, verdana',
              field: 'number',
              renderer: function(v){
                return Ext.String.format(v.toFixed(2).toString().replace('.',','));
              },
              orientation: 'vertical',
              color: '#fff'
            },
            xField: 'data',
            yField: 'number'
          }
        ]
    });
    And this is the Store:
    Code:
    Ext.define('MyApp.store.ChartStore', {
        extend: 'Ext.data.Store',
    
    
      model: 'MyApp.model.ChartStore',
        alias  : 'store.mystore',
    
    
        autoLoad: false,
      groupField: 'name',
    
    
      // pageSize: 25,
    
    
        proxy: {
            type: 'ajax',
            api: {
          read: 'resources/data/ajx_list_chart.php'
        },
        reader: {
          type: 'json',
          root: 'data',
          // totalProperty: 'total',
          successProperty: 'success'
        },
        writer: {
          type: 'json',
          root: 'data',
          encode: true
        }
        }
    });
    Thanks!

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    What version of Cmd are you running? What specific version of Ext JS?

  3. #3
    Sencha User
    Join Date
    Jun 2011
    Posts
    185
    Answers
    6

    Default

    I'm using ExtJS 4.2 and Sencha Cmd v4.0.4.84Thanks

  4. #4
    Sencha User
    Join Date
    Jun 2011
    Posts
    185
    Answers
    6

    Default

    up

  5. #5
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Are you seeing any errors from Cmd during the build? What does your data look like?

  6. #6
    Sencha User
    Join Date
    Jun 2011
    Posts
    185
    Answers
    6

    Default

    No errors occured during the build.
    The response is a simple json like:
    Code:
    {"data":[{"number":"39.96","data":"04\/06\/2015"}]}

  7. #7
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Quote Originally Posted by rafaelrp View Post
    Code:
          read: 'resources/data/ajx_list_chart.php'
    Are you certain that your production build is able to access your relative URL?

  8. #8
    Sencha User
    Join Date
    Jun 2011
    Posts
    185
    Answers
    6

    Default

    Yes, because i have a grid that loads this store too and everything is normal

  9. #9
    Sencha User
    Join Date
    Jun 2011
    Posts
    185
    Answers
    6

    Default

    up!It's possible that is a bug?

  10. #10
    Sencha User
    Join Date
    Jun 2011
    Posts
    185
    Answers
    6

    Default

    up!

Similar Threads

  1. Replies: 13
    Last Post: 27 Jul 2015, 4:51 AM
  2. Problem with extjs charts when ajax request return values 0.
    By gabvalentin in forum Ext: Discussion
    Replies: 2
    Last Post: 16 Apr 2012, 9:15 AM
  3. Problem rendering Google charts in extjs 4.
    By RashmiBhadsawle in forum Ext: Discussion
    Replies: 0
    Last Post: 11 Jul 2011, 1:29 AM
  4. ExtJS4 Charts - Use ExtJS 3.2.1 Stores in ExtJS 4 Charts
    By beerumrakesh in forum Ext: Discussion
    Replies: 0
    Last Post: 12 Jun 2011, 11:19 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •