开发者社区> 问答> 正文

ehcart3 restore 事件?报错

我更新ECharts3

restore 方法报错

报错信息如下:

Uncaught TypeError: chart.restore is not a function

代码:

var chart = echarts.init(document.getElementById(a));
chart.setTheme(theme);
$.ajax({ 
   type:"POST", 
url:b, 
async:false,
contentType:"application/json",               
success:function(data){ 
var bToObj = eval('('+data+')');
//var bToObj=JSON.parse(data);
chart.setOption(bToObj); 
},
error: function (error) {
timeout = true;
console.log(error);
}
});
chart.restore();
chart.resize();
大神求教了



展开
收起
爱吃鱼的程序员 2020-06-09 16:18:04 515 0
2 条回答
写回答
取消 提交回答
  • chart.restore();不应该这么调用 正确调用方法: chart.dispatchAction({type: 'restore'})

    2023-04-23 16:43:05
    赞同 展开评论 打赏
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    events:restore怎么调用呀,万分感谢

    已解决了


    楼主,这个restore是toolbox里的restore么?要想实现点击restore图标动态刷新图表数据,该怎么实现呢?

    2020-06-09 16:18:23
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载