怎么样让ECharts从后台获取数据并展示
展开全部
调用后台接口,ajax获取数据
function getspslztslbh(city,date){
$.ajax({
url: ctx+"/index/spscztGroup.do
",
type:"post",
data: {
"city": city,
"date":date
},
dataType: "json",
success: function(data){
拿到数据重新setoption
myChartz.setOption({
xAxis: {
data: data.list2
},
yAxis: [{
min: mind,
max: maxd,
interval: ava1
},{
min: mind3,
max: maxd3,
interval: ava2
}],
}
function getspslztslbh(city,date){
$.ajax({
url: ctx+"/index/spscztGroup.do
",
type:"post",
data: {
"city": city,
"date":date
},
dataType: "json",
success: function(data){
拿到数据重新setoption
myChartz.setOption({
xAxis: {
data: data.list2
},
yAxis: [{
min: mind,
max: maxd,
interval: ava1
},{
min: mind3,
max: maxd3,
interval: ava2
}],
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询