EXT 4.0 차트

2228 단어 ext
function search_Top()
{
	
	$("#Tchart > * ").remove();
	
	// 
	getData();
}

function getData(){
 	var sd = sd_date.getSubmitValue();
 	var ed = ed_date.getSubmitValue();
 	var income=$("#income").val();
 	var keyword = $("#keyword").val();
 	var top = $("#top").val();
	$.post("/rest/tcustomerStat/data/tcustomerToChart", { s_cdate: sd, e_cdate: ed ,income:income ,keyword:keyword, top: top },
				  function(result){
						
						loadChart(eval("(" + result + ")"));// js 
	});
}



function loadChart(dd){
	
		var dataStore = new Ext.data.JsonStore({
			fields:['partyb', 'ccount', 'growing'],
			data: dd
		});
		Ext.create('Ext.panel.Panel', {
			title : ' ',
			width : '100%',
			height : 400,
			renderTo: 'Tchart',
			layout : 'fit',
			items : [{
				xtype : 'chart',
				store : dataStore,
				animate : true,// 
				legend : {
					position : 'bottom' // 
				},
				shadow : true,
				series : [{
					type : 'pie',// 
					field : 'ccount',// 
					showInLegend : false,//   ----------- 
					label : {
						field : 'partyb',// 
						contrast : true,
						color : '#FFFF00',
						renderer : function(v){// 
							return v;
						},
						display : 'middle',// 
						font : '0px "Lucida Grande"'// 
					},
					highlight : {
						segment : {
							margin: 6 // 
						}
					},
					tips : {
						trackMouse : true, //  
						width : 168,
						height : 30,
						renderer : function(storeItem) {//    
							 var title =  storeItem.get('partyb') + ':'+ (storeItem.get('growing')*100).toFixed(3)+"%";
							this.setTitle(title);
						}
					}
				}]
			}]
		});
}

좋은 웹페이지 즐겨찾기