2015-10-13 41 views
2

您好,我正在嘗試將CartesianChart放置在傳送帶內,但它不會 渲染。 所以,如果我調用圖表使用這樣的:傳送帶或任何其他容器內的Sencha觸摸圖表

Ext.create('app.view.CompanyStockChart', {fullscreen: true}); 

它工作得很好,就像這樣:

Example1

如果我使用轉盤來渲染圖,這是行不通的,並且只顯示SenchaTouch的標誌:

Example2

代碼:

var pnl5=Ext.create('Ext.Panel', { 
     layout: { 
       type: 'vbox', 
       align: 'middle' 
      }, 
     title: 'Chart', 
     iconCls: 'overview', 
     items:[{ 
     xtype: 'companystockchart' 
     }], 
     listeners: { 
      activate: function() { 
      } 
     } 
    }) 

    var crs = Ext.create('Ext.Carousel', { 
     fullscreen: true, 
     direction: 'horizontal', 
     defaults: { 
      styleHtmlContent: true 
     }, 
     items: [ 
     pnl1, 
     pnl5, 
     pnl2, 
     pnl3, 
     pnl4 
     ] 
    }); 

代碼companystockchart的:當我使用其它類型的容器,而不是轉盤的

Ext.define('app.view.CompanyStockChart', { 
    extend: 'Ext.chart.CartesianChart', 
    alias: 'widget.companystockchart', 

config: { 
    store: 'StockDataStore', 
    axes: [ 
     { 
      type: 'time', 
      fields: [ 
       'date' 
      ] 
     }, 
     { 
      type: 'numeric', 
      fields: [ 
       'open' 
      ], 
      grid: { 
       odd: { 
        fill: '#e8e8e8' 
       } 
      }, 
      position: 'left' 
     } 
    ], 
    series: [ 
     { 
      type: 'line', 
      style: { 
       smooth: true, 
       stroke: 'rgb(0,200,0)', 
       fill: 'rgba(0,200,0,0.3)' 
      }, 
      xField: 'date', 
      yField: 'open' 
     } 
    ], 
    interactions: [ 
     { 
      type: 'panzoom' 
     } 
    ] 
} 

}); 

出現相同的問題。 我該如何解決這個問題? 請幫助我)

回答

0

感謝名單全部,我一直在使用的佈局做到了:在pnl5的配置節「適應」

var pnl5=Ext.create('Ext.Panel', { 
     layout: 'fit', 
     title: 'Chart',