echarts没有提供相关事件,需要我们稍微修改下源码
找到DataView.prototype.onclick事件
加上或替换掉事件里的相关close代码
var onClose = model.get('onClose');
function close() {
container.removeChild(root);
self._dom = null;
if(typeof onClose === 'function'){
onClose();
}
}
然后在option里可以写响应操作执行
onClose: function(){//需要在echarts源码加上监听事件
$('#content_new .chartpanel>div').each(function(){
if($(this).attr('id')==chartId){
$(this).css('height',chartHeight);
}else{
$(this).css('display','block');
}
})
}