function reloadTable() {
var iii = layer.load(1, {shade: [0.1,'#fff'] });//提交的动画
url = "change/query?selectType=" + $("#selectType").val() + "&xlName=" + $("#xlname").val()+"&stationid="+$("#station").val();
$.get(url, function (data) {
layer.close(iii)//销毁动画
var memoLegend = []
var memoList = []
echarts.init(document.getElementById('memoBar')).dispose();//销毁前一个实例
memoBar = echarts.init(document.getElementById('memoBar'));//构建下一个实例
option =
title : {
text: '变更原因次数',
},
tooltip : {
trigger: 'axis',
axisPointer : { // 坐标轴指示器,坐标轴触发有效
type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
legend: {
data:['次数']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis : [{
type : 'value'
}],
yAxis : [{
type : 'category',
axisTick : {show: false},
data : memoLegend
}],
series : [{
name:'次数',
type:'bar',
label: {
normal: {
show: true
}
},
data:memoList
}]
};
memoBar.setOption(option, true);
});
}
memoBar.on('click', function (param) {
console.log('点击了我!');
console.log(param)
});
当然 先销毁再创建就不