admin管理员组文章数量:1393843
I've been using the react-jsx-highcharts module, to integrate Highcharts into my React app.
Works great. Now I want to include the boost module. I'm not sure how to do this. I tried simply adding import 'highcharts/modules/boost'
but this doesn't seem to work.
Anyone know how to go about this?
I've been using the react-jsx-highcharts module, to integrate Highcharts into my React app.
Works great. Now I want to include the boost module. I'm not sure how to do this. I tried simply adding import 'highcharts/modules/boost'
but this doesn't seem to work.
Anyone know how to go about this?
Share Improve this question edited Mar 26, 2018 at 13:11 Daniel Loiterton asked Jan 26, 2018 at 11:29 Daniel LoitertonDaniel Loiterton 5,3185 gold badges35 silver badges51 bronze badges 1-
1
highcharts-more
andmodules/boost
work the same way :) So yes, use the samerequire(...)(Highcharts)
and it will work. – Paweł Fus Commented Jan 26, 2018 at 11:50
1 Answer
Reset to default 10This is a feature of the highcharts
module (not react-jsx-highcharts
) and is explained in its documentation:
var Highcharts = require('highcharts');
require('highcharts/modules/boost')(Highcharts);
Alternatively, you can use import
like so:
import Highcharts from 'highcharts';
import boost from 'highcharts/modules/boost';
boost(Highcharts);
本文标签: javascripthow to import highcharts sub modules in React appStack Overflow
版权声明:本文标题:javascript - how to import highcharts sub modules in React app - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744084129a2588197.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论