wangshijun / angular-echarts

:chart: angularjs bindings for baidu echarts
355 stars 141 forks source link

echarts is not defined #67

Open lvyulong opened 7 years ago

LaureMonlouis commented 7 years ago

I have the same trubble : ReferenceError: echarts is not defined

It comes from /dist/angular-echarts.js var options; getSizes(scope.config); if (!chart) { chart = echarts.init(ndWrapper, theme.get(scope.config.theme || 'macarons')); }

wangpenghui commented 7 years ago

ReferenceError: echarts is not defined,i also found

AllenZhang34 commented 7 years ago

I have the same trubble : ReferenceError: echarts is not defined

wangshijun commented 7 years ago

@lvyulong @LaureMonlouis did you included echarts and angular lib as docs/index.html ? I that was done properly, this error should not exists.

If the error still exists, please provided your detailed code

bainana commented 6 years ago

如果是只安装了angular-echarts,还需要再安装下echarts,这样就不会报错了。

SyedWasiHaider commented 6 years ago

For anyone else who hates themselves and still uses AngularJS in 2018, the way to fix this is to make sure the window object has access to echarts.

So simply do:

window.echarts = require 'echarts/dist/echarts.js'

jimmy240341 commented 6 years ago

Similar problem was happened, and fixed it by changing the loaded file from echarts.js to ceharts-all.js.