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');
}
})
}