问题
I would like to use highcharts. I did bower install highcharts.com
(highcharts recommends using highcharts.com.
However, I have no idea what to include in my html file. I am guessing 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 ?
回答1:
I ran into the same problem you can do the following for highcharts
bower install highcharts-release
and to get highstock you can do this
bower install highstock-release
and you would include one of the following
'/bower_components/highcharts-release/highcharts.js'
'/bower_components/highstock-release/highstock.js'
回答2:
As Erik mentioned, use the release version of Highcharts JS:
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.
Otherwise, include the javascript files that are part of the package:
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
回答3:
Try the release version: https://github.com/highslide-software/highcharts-release.
This is the official shim repo for Highcharts JS releases including minified files. It is optimized for inclusion by Bower.
来源:https://stackoverflow.com/questions/21042458/how-to-include-highcharts-with-bower