2014-09-28 149 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