Ext JS4学习教程+笔记(八)Ext.chart.Chart
Ext JS的图表功能,其类名为Ext.chart.Chart。
示例代码如下:function chartTest(){
var store1 = Ext.create('Ext.data.Store',{
fields:['name','age'],
proxy:{
type:'ajax',
url:'data.txt',
reader:{
type:'json',
root:'items3'
}
}
});
store1.load(function(records, operation, success) {
Ext.create('Ext.chart.Chart',{
renderTo:Ext.getBody(),
width:500,
height:300,
animate:true,
store:store1,
axes:[
{
type:"Numeric",
position:'left',
fields:['age'],
title:'年龄',
grid:true,
minimum: 0
},
{
type:'Category',
position:'bottom',
fields:['age'],
title:'姓名'
}
],
series:[
{
type:'line',
xField:'name',
yField:'age',
axis:'left',
}markerConfig: {type: 'cross',size: 4,radius: 4,'stroke-width': 0}