xieziyu / ngx-echarts

An angular (ver >= 2.x) directive for ECharts (ver >= 3.x)
https://xieziyu.github.io/ngx-echarts/
MIT License
1.11k stars 197 forks source link

Echart is not defined #33

Closed Karine-GitHub closed 7 years ago

Karine-GitHub commented 7 years ago

Hello,

I have the following error when I try to display a pie chart :

PieChartComponent.html:1 ERROR ReferenceError: echarts is not defined 
at angular-echarts.directive.js:30
at ZoneDelegate.invoke (zone.js:392)
at Zone.run (zone.js:142)
at NgZone.runOutsideAngular (core.es5.js:3844)
at AngularEchartsDirective.createChart (angular-echarts.directive.js:30)
at AngularEchartsDirective.onOptionsChange (angular-echarts.directive.js:65)
at AngularEchartsDirective.ngOnChanges (angular-echarts.directive.js:50)
at checkAndUpdateDirectiveInline (core.es5.js:10831)
at checkAndUpdateNodeInline (core.es5.js:12330)
at checkAndUpdateNode (core.es5.js:12269)

I followed these steps for install:

I'm using angular 4.2.6

Thanks in advance

csulxk commented 7 years ago

同样遇到 echarts is not defined 问题 我使用的是angular-cli,angular-cli.json里确定是加入了echarts,尝试直接在index.html引入echarts.js,还是一样。 版本信息 angular-cli: 1.4.3 angular: 4.4.3

xieziyu commented 7 years ago

Please try to remove node_modules and do npm install again.

Karine-GitHub commented 7 years ago

@xieziyu I try to implement ngx-echarts in a simple sample project and it works fine. The issue comes from my final project (webpack old version or configuration, I don't know exactly).