`
bainian_205
  • 浏览: 45090 次
  • 性别: Icon_minigender_1
  • 来自: 河北
社区版块
存档分类
最新评论

一个简单的extjs chart练习

阅读更多
做了一个简单的extjs chart练习,数据是从struts后台得到的,一点注意的就是jsonstore的autoLoad属性要设置成true

ChartPanel = Ext.extend(Ext.Panel,{
mydocumentChart:null,
constructor:function() {
this.mydocumentChart = new DocumentChart();
ChartPanel.superclass.constructor.call(this,{
width:600,
height:300,
frame:true,
layout:"fit",
renderTo:"chartPanel",
items:[this.mydocumentChart]
});
}
});
/*****************************************************************************************/
DocumentChart = Ext.extend(Ext.chart.ColumnChart,{
myChartStore:null,
constructor:function() {
this.myChartStore = new ChartStore();
DocumentChart.superclass.constructor.call(this,{
store:this.myChartStore,
url:"ext/resources/charts.swf",
xField:"department",
yField:"documentNumber"
});
}
});
/*****************************************************************************************/
ChartStore = Ext.extend(Ext.data.JsonStore,{
constructor:function() {
  ChartStore.superclass.constructor.call(this,{
  autoLoad:true,
url:"http://139.28.96.10:8080/premanagement3/secure/chart",
root:"documentCounts",
fields:["department","documentNumber"]
});
}
});
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics