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

How to use echarts offline? #1

Closed
bubifengyun opened this issue Aug 17, 2015 · 4 comments
Closed

How to use echarts offline? #1

bubifengyun opened this issue Aug 17, 2015 · 4 comments

Comments

@bubifengyun
Copy link

你好,我的网站无法访问外网。在yii2,php下开发。我也看到你的配置里有

 public static $dist = 'https://cdnjs.cloudflare.com/ajax/libs/echarts/2.2.5';

我想把他替换为本地已经下载好的echarts,可有好的办法吗?
或者可以把这个方法写在readme.md里。
谢谢。

@hisune
Copy link
Owner

hisune commented Aug 18, 2015

如果需要以yii2的方式加载前端文件,需要注册asset目录。以下是更简单直接一点的解决办法:

Hisune\EchartsPHP\Config::$dist = dirname(yii::$app->request->getScriptUrl()) . '/js/echarts';

echarts的js文件放在web/js/echarts中即可

@hisune hisune closed this as completed Aug 19, 2015
@bubifengyun
Copy link
Author

我觉得放在web/js/echarts这种方式代码构架不好。可能注册asset的方式会好点吧。

@hisune
Copy link
Owner

hisune commented Aug 23, 2015

就yii的规范来说,肯定是注册asset目录的方式更规范,但这个Echarts-PHP不是一个yii插件。

@bubifengyun
Copy link
Author

只好先应急了。后续成熟了,争取把echarts跟yii2的接口过程给总结一下。

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

2 participants