2014-09-28 212 views
2

是新來的ExtJS的,並有一個圖表,我在手風琴的地方,但是當我調整手風琴,圖表不resize.Please幫助 下面圖表裏面是我的代碼的手風琴

var chart1 = Ext.create('Ext.chart.Chart',{ 
     animate: true, 
     store: store, 
     height:500, 
     width:340, 
     layout:'fit', 
     legend:{ 
      visible:true, 
      position:'right', 
      labelFont:'10px Comic Sans MS' 
     }, 
     margin:'30 0 0 0', 
     //autoHeight:true, 
     //insetPadding: 30, 
     //other code here....................... 
    }); 

這裏對於面板

var chartPanel = new Ext.Panel({ 
     title:'Visualization Charts', 
     //cls:'empty', 
     items:[chart1] 
    }); 

代碼手風琴

var myaccordionwest = new Ext.Panel({ 
     title:'Data Visualization', 
     region:'west', 
     //margin:'5 0 5 5', 
     split:true, 
     width:'27%', 
     layout:'accordion', 
     collapsible:true, 
     items:[chartPanel] 
    }); 

回答

1

你有hardc代碼圖表的寬度和高度。應該在帶有一個子項目的容器上使用佈局配合。因此,圖表上的佈局並不意味着什麼,您應該將其移至chartPanel。

所以這應該工作:

var chart1 = Ext.create('Ext.chart.Chart',{ 
     animate: true, 
     store: store, 
     legend:{ 
      visible:true, 
      position:'right', 
      labelFont:'10px Comic Sans MS' 
     }, 
     margin:'30 0 0 0', 
     //autoHeight:true, 
     //insetPadding: 30, 
     //other code here....................... 
    }); 

var chartPanel = new Ext.Panel({ 
     title:'Visualization Charts', 
     //cls:'empty', 
     items:[chart1] 
    }); 

var myaccordionwest = new Ext.Panel({ 
     title:'Data Visualization', 
     region:'west', 
     layout:'fit', 
     //margin:'5 0 5 5', 
     split:true, 
     width:'27%', 
     layout:'accordion', 
     collapsible:true, 
     items:[chartPanel] 
    }); 
+0

我也做了改變,它工作正常now.Thanks – Wanjohi254 2014-09-28 15:06:09

+0

如果我的回答幫你比請單擊複選標記接受它 – 2014-09-28 15:13:13