,拆线图
//数据,JSON
var murl = ‘data.aspx’;
var store = new Ext.data.JsonStore({
url: murl,
autoLoad:true,
root: ‘images’,
fields: ['name', 'visits', 'views']
});
//显示
new Ext.Panel({
iconCls:’chart’,
title: ‘ExtJS.com Visits Trend, 2007/2008 (Simple styling)’,
frame:true,
renderTo: ‘container’,
width:500,
height:300,
layout:’fit’,
items: {
??? xtype: ‘linechart’,
??? store: store,
??? url: ‘../ExtLib/resources/charts.swf’,
??? xField: ‘name’,
??? yField: ‘visits’,
??? yAxis: new Ext.chart.NumericAxis({
??????? displayName: ‘Visits’,
??????? labelRenderer : Ext.util.Format.numberRenderer(’0,0′)
??? }),
??? tipRenderer : function(chart, record){
??????? return Ext.util.Format.number(record.data.visits, ’0,0′) + ‘ visits in ‘ + record.data.name;
??? }
}
});