简体   繁体   English

如何在凉亭中加入高图?

[英]How to include highcharts with bower?

I would like to use highcharts. 我想用highcharts。 I did bower install highcharts.com ( highcharts recommends using highcharts.com . 我做了bower install highcharts.comhighcharts建议使用highcharts.com

However, I have no idea what to include in my html file. 但是,我不知道在我的html文件中包含什么。 I am guessing bower_components/highcharts.com/js/highcharts.src.js . 我在猜bower_components/highcharts.com/js/highcharts.src.js But this is a huge file, and it will slow the build process if I minify it every build... 但这是一个巨大的文件,如果我在每次构建时缩小它,它将减慢构建过程...

How should I include highcharts with bower ? 我应该如何在凉亭中加入高级图表?

I ran into the same problem you can do the following for highcharts 我遇到了同样的问题,你可以为highcharts做以下事情

bower install highcharts-release bower安装highcharts-release

and to get highstock you can do this 为了获得高价,你可以做到这一点

bower install highstock-release 凉亭安装highstock-release

and you would include one of the following 你会包括以下之一

'/bower_components/highcharts-release/highcharts.js'
'/bower_components/highstock-release/highstock.js'

As Erik mentioned, use the release version of Highcharts JS: 正如Erik所说,使用Highcharts JS的发布版本:

https://github.com/highslide-software/highcharts-release https://github.com/highslide-software/highcharts-release

If you're using grunt, simply run grunt bower-install and it will install the dependencies into your project. 如果您正在使用grunt,只需运行grunt bower-install,它就会将依赖项安装到您的项目中。

Otherwise, include the javascript files that are part of the package: 否则,请包含属于包的javascript文件:

bower_components/highcharts-release/highcharts.js
bower_components/highcharts-release/highcharts-more.js

and if you plan on exporting: 如果您计划出口:

bower_components/highcharts-release/modules/exporting.src.js

Try the release version: https://github.com/highslide-software/highcharts-release . 试试发布版本: https//github.com/highslide-software/highcharts-release

This is the official shim repo for Highcharts JS releases including minified files. 这是Highcharts JS版本的官方垫片回购,包括缩小文件。 It is optimized for inclusion by Bower. 它经过优化,可供Bower使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM