日期:2014-05-16 浏览次数:20385 次
[code=JScript]
Ext.chart.Chart.CHART_URL='Ext/resources/charts.swf'; //模板falsh
Ext.onReady( //onReady函数入参是一个函数
function(){
//var store=new Ext.data.JsonStore({
// fields:['name','visits','views'],
//data:[
//{name:'Jul 07',visits:245000,views:300000},
// {name:'Aug 07',visits:240000,views:350000},
// {name:'Sep 07',visits:335000,views:400000},
//{name:'Oct 07',visits:375000,views:420000},
//{name:'Nov 07',visits:490000,views:550000},
//{name:'Dec 07',visits:495000,views:580000},
//{name:'Jan 07',visits:520000,views:600000},
//{name:'Feb 07',visits:620000,views:750000}
//]
//});
var MyRecord = Ext.data.Record.create([
{name: 'name'},
{name: 'visits'},
{name: 'views'}
]);
var pie_mananode_store = new Ext.data.Store({
proxy : new Ext.data.HttpProxy({
url : 'testchartajaxjson.jsp'
}),
reader : new Ext.data.JsonReader(
{
root : 'data'
}, MyRecord),
baseParams:
{
type:1
}
});
pie_mananode_store.load();
alert(MyRecord.getField("name"));
new Ext.FormPanel({
title:'ExtJs pieChart',
autoWidth:true,
height:500,
renderTo:'container',
iconCls:'chart',
frame:true,
items:[{
fieldLabel:'饼图1',
name:'piechart1',
xtype: