地圖動態(tài)顯示數(shù)據(jù)庫數(shù)據(jù)
通過ajax已經(jīng)把數(shù)據(jù)庫中的數(shù)據(jù)讀出來了放在了psite數(shù)組里,現(xiàn)在給data=[name:? ,value: ]里的value賦值,value:psite[0],但是顯示失敗了,代碼如下,應(yīng)該怎么辦呢???
var psite=[];? //放站點數(shù)量
? ? $.ajax({
? ? type : "post",
? ? async : true,?
? ? url : "../map/selectMap.do",?
? ? data : {},
? ? dataType : "json",?
? ? success : function(result) {
? ? if (result) {
? ? psite.push(result[i].psite);
? ? myChart.hideLoading();
? ? }else {
? ? ? ? alert("圖表請求數(shù)據(jù)為空,可能服務(wù)器暫未錄入近五天的觀測數(shù)據(jù),您可以稍后再試!");
? ? ? ? ? ? myChart.hideLoading();
? ? ? ? ?}
? ? }
? ? })
var data = [
? ? {name:"北京",value:psite[0]},
? ? {name:"天津",value:42},
]