Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

echarts is not defined #59

Open
renmengting opened this issue Jan 5, 2018 · 5 comments
Open

echarts is not defined #59

renmengting opened this issue Jan 5, 2018 · 5 comments

Comments

@renmengting
Copy link

echarts应该是加载了,但是还是弹出提示说 echarts is not defined,能帮忙看下是什么问题吗?
用的是asp.net core + angular +webpack

webpack 里已经加了 new webpack.ProvidePlugin({ ...,echarts: 'echarts' }),

第一行是已经加载的echarts信息console.log(echarts);
第二行是调用<div echarts [options]="options" style="height:150px"></div>显示的错误信息
qq 20180105123741

@xieziyu
Copy link
Owner

xieziyu commented Jan 8, 2018

这个需要具体看项目的配置

@helloneoberg
Copy link

@renmengting 请问你有解决这问题吗?
可以分享你的解决方案吗?

@helloneoberg
Copy link

好不容易终于解决问题.
我把 “new webpack.ProvidePlugin({ echarts: 'echarts' })” 加到 “webpack.config.js”, 放在第一条线。
希望对用asp.net core 2.0 + angular 4 + webpack 的朋友们有帮助。

webpack_config_js

@txd331
Copy link

txd331 commented Mar 15, 2018

我今天刚遇到这个问题,解决方案跟楼上的相似。我用的angular-cli。.angular-cli.json文件里加入如下
{
...,
"scripts": [
"../node_modules/echarts/dist/echarts.min.js",
"../node_modules/echarts/dist/extension/bmap.min.js",
...
],
...
}

@liusongge
Copy link

liusongge commented Aug 1, 2019

今天也遇到这个问题,最后在main.js 里引入 echarts
import * as echarts from 'echarts';
window['echarts'] = echarts;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants