Results 1 to 1 of 1

Thread: ?Ext.chart.Chart??Axes??Type?"Time?"????????????????

  1. #1
    Ext JS Premium Member
    Join Date
    Jan 2012
    Posts
    1
    Vote Rating
    0
      0  

    Default ?Ext.chart.Chart??Axes??Type?"Time?"????????????????


    ???????ext-4.0.7?????????

    ????????X???????????????X????????
    ???????????
    ?X??2011/01/01,02/01,03/01??????????
    ???????2011/1/15?????2011/01/01?02/01??????????

    ?????????????????????????????????WS000000.jpg
    ??????????????2011/01/01,01/31,03/01????
    ????????????2011/01/01,02/01,03/01????

    ???????axes:?Step:[Ext.Date.MONTH,1]???????????????????
    ????????????????????????????????
    ????
    Code:
    Ext.require(['Ext.chart.*']);
    Ext.require(['Ext.data.*']);
    Ext.onReady(function(){ 
    Ext.define('WeatherPoint', { 
    extend: 'Ext.data.Model' 
    ,fields: ['temperature', 'date'] 
    }); 
    var store = Ext.create('Ext.data.Store', { 
    model: 'WeatherPoint' 
    ,data: [ 
    {temperature: 58, date: Ext.util.Format.date(new Date(2011, 1, 2),'Y/m/d')} 
    ,{temperature: 63, date:Ext.util.Format.date(new Date(2011, 3, 3),'Y/m/d')} 
    ,{temperature: 73, date:Ext.util.Format.date(new Date(2011, 4, 4),'Y/m/d')} 
    ,{temperature: 78, date:Ext.util.Format.date(new Date(2011, 5, 5),'Y/m/d')} 
    ,{temperature: 81, date:Ext.util.Format.date(new Date(2011, 6, 6),'Y/m/d')} 
    ] 
    }); 
    Ext.create('Ext.chart.Chart', { 
    renderTo: Ext.getBody() 
    ,width: 1000 
    ,height: 500 
    ,store: store 
    ,axes: [ 
    { 
    title: 'Temperature' 
    ,type: 'Numeric' 
    ,position: 'left' 
    ,fields: ['temperature'] 
    ,mininum: 0 
    ,maximum: 100 
    } 
    ,{ 
    title: 'Time' 
    ,type: 'Time' 
    ,position: 'bottom' 
    ,fields: ['date'] 
    ,groupBy: 'year,month,day' 
    ,dateFormat: 'Y/m/d' 
    ,fromDate:new Date(2010, 12, 1)
    ,toDate:new Date(2011, 12, 1)
    ,step:[Ext.Date.MONTH,1]
    ,label: {
    rotate: {
    degrees: 315
    }
    }
    } 
    ] 
    ,series: [ 
    {
    type: 'line' 
    ,xField: 'date' 
    ,yField: 'temperature',
    markerConfig:{
    type: 'cross',
    size: 4,
    radius: 4,
    'stroke-width': 0
    }
    }
    ] 
    }); 
    });
    Last edited by dawesi; 4 Dec 2012 at 9:28 PM. Reason: ?????????

Posting Permissions

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