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

      0  

    Default Ext.chart.axis.Time

    Ext.chart.axis.Time


    Hello everybody,

    I would like to use the type 'time' for the xAxis of a chart.
    Here is the code:

    Code:
    Ext.define('MainApp.view.tools.ChartLinesView', {
        extend: 'Ext.chart.Chart',
        alias : 'widget.chartlines',
        height: 229,
        width: 722,
        animate: true,
        insetPadding: 20,
        store: 'FactureStore',
    
          initComponent: function() {
            var me = this;
            me.axes = [
                {
                    type: 'Time',
                    fields: 'Date_index',
                    title: 'Mois',
                    position: 'bottom',
                    dateFormat: 'M',
                    groupBy: 'month',
                    aggregateOp: 'sum',
                    constrain: true,
                    fromDate: new Date('1/1/11'),
                    toDate: new Date('1/7/11')
                },
                  {
                    type: 'Numeric',
                    fields: [
                          'Montant_net'
                    ],
                    position: 'left',
                    title: 'Montant net'
                  }
            ];
                me.series = [
                  {
                    type: 'columns',
                    xField: 'Date_index',
                    yField: [
                      'Montant_net'
                    ],
                    smooth: 3
                  }
            ];
            me.callParent(arguments);
          }
    });
    In Firebug, i have the following error :

    a.getMonth is not a function
    http://localhost/EnergyWatch/app/ext4/ext-all.js
    Line 1

    What i'm doing wrong?

    Thank you very much for your help!

  2. #2
    Ext JS Premium Member
    Join Date
    Jul 2010
    Location
    UK
    Posts
    526
    Vote Rating
    29
    MrSparks has a spectacular aura about MrSparks has a spectacular aura about

      0  

    Default


    Looking at the docs, I think you need to use a different date format.

    fromDate: new Date(2011, 1, 1),
    toDate: new Date(2011, 1, 7),

Thread Participants: 1

Tags for this Thread