echarts icon indicating copy to clipboard operation
echarts copied to clipboard

echarts3和echarts2同时引用,报echarts未定义

Open create-top opened this issue 10 years ago • 1 comments

问题简述 (One-line summary)

同一个页面有的图用到了echarts2,有的图用到了echarts3,同时引用, echarts.registerTheme()会报“echarts未定义”的错

版本及环境 (Version & Environment)

  • ECharts 版本 (ECharts version):echarts3和echarts2同时引用
  • 浏览器类型和版本 (Browser version):IE9和chrome都有此问题
  • 操作系统类型和版本 (OS Version):win10和winserver2008

重现步骤 (Steps to reproduce)

1.同一个页面有的图用到了echarts2,有的图用到了echarts3,同时引用

期望结果 (Expected behaviour)

echarts3和echarts2能同时引用

可能哪里有问题 (What went wrong)

echarts同时存在于echarts3和echarts2

ECharts配置项 (ECharts option)

var theme = new echartTheme();
echarts.registerTheme(options.Theme, theme.getTheme(options.Theme));
var myChart = echarts.init(document.getElementById(This[0].id), options.Theme);

其他信息 (Other comments)

create-top avatar Oct 12 '16 09:10 create-top

我也遇到了同样的问题,网上搜只能以script标签导入,这样太暴力了吧。。

shicaokuangmo avatar Dec 20 '17 03:12 shicaokuangmo