Uncaught ReferenceError: m is not defined
//分时图
var myChart2 = echarts.init(document.getElementById('main2'));
var option2 = {
tooltip: {
trigger: 'axis',
},
grid: {
show:true,
left: '5%',
right: '5%',
containLabel: true,
top:5,
bottom:0
},
xAxis: {
type: 'category',
data: [],
boundaryGap: false,
gridIndex: 0,
splitLine: {
show: true
},
axisLabel:{
color:'white'
}
},
yAxis: {
type: 'value',
boundaryGap: false,
min:'dataMin',
max:'dataMax',
axisLabel:{
color:'white'
}
},
series: [{
data: [],
type: 'line',
symbol: 'none',
lineStyle:{
width:1
},
itemStyle: {
normal: {
color: '#E2E0DD'
},
},
areaStyle:{
color:'#E2E0DD'
}
}]
};
setTimeout(function(){
myChart2.setOption(option2);
}, 1000);
var nowproduct_no= $("#nowproduct_no").val();
$.get('__MODULE__/Point/getFenshitu?product='+nowproduct_no).done(function (data) {
var data=JSON.parse(data);
var Len=parseInt(data.data.length);
setTimeout(function(){
myChart2.setOption({
xAxis: {
data: data.time
},
series: [{
name:'行情',
data: data.data,
}]
});
}, 1000);
});
window.setInterval(function () {
var nowproduct_no= $("#nowproduct_no").val();
$.ajax({
type: "post",
url: "__MODULE__/Point/getFenshitu",
data : "product="+nowproduct_no , //注意这里必须用=
async: true,
success: function (data) {
var data=JSON.parse(data);
var Len=parseInt(data.data.length);
setTimeout(function () {
myChart2.setOption({
xAxis: {
data: data.time
},
series: [{
name: '行情',
data: data.data,
}]
});
}, 1000);
}
});
}, 1000);
你的接口是jsonp的?看样子是接口的报错和echarts没什么关系吧