react-highcharts-v5
v2.0.1
Published
React.js(v16.x+) component wrap for HighCharts.js(v6.x+)
Downloads
13
Maintainers
Readme
react-highcharts-v5
React.js(v16.x+) component wrap for HighCharts.js(v6.x+)
Installation
$ npm install --save highcharts react-highcharts-v5
Usage
Change webpack config
For webpack 1.x:
{ test: /\.jsx?$/, loader: 'babel', include: [ - path.join(prjRoot, 'src') + path.join(prjRoot, 'src'), + path.join(prjRoot, 'node_modules/react-highcharts-v5/src') ], - exclude: /node_modules/ + exclude: /node_modules(?![\\/]react-highcharts-v5[\\/]src[\\/])/ },
For webpack 2.x+:
{ test: /\.jsx?$/, loader: 'babel-loader', - include: [resolve('src'), resolve('test')] + include: [resolve('src'), resolve('test'), resolve('node_modules/react-highcharts-v5/src')] }
Import HighCharts
import IHighCharts from 'react-highcharts-v5/src/HighCharts.js'; export default () => { const options = {}; return ( <IHighCharts options={options} /> ); };
Import HighMaps
import IHighCharts from 'react-highcharts-v5/src/HighMaps.js'; export default () => { const options = {}; return ( <IHighCharts options={options} /> ); };
Import HighStock
import IHighCharts from 'react-highcharts-v5/src/HighStock.js'; export default () => { const options = {}; return ( <IHighCharts options={options} /> ); };
propTypes
className: PropTypes.string,
style: PropTypes.object,
loading: PropTypes.oneOfType([
PropTypes.string,
PropTypes.bool
]),
theme: PropTypes.object,
resizable: PropTypes.bool,
options: PropTypes.object.isRequired,
onLoad: PropTypes.func,
onResize: PropTypes.func
defaultProps
className: 'react-highcharts',
style: {
width: '100%',
height: '100%'
},
loading: false,
theme: null,
resizable: false,
onLoad: () => {},
onResize: (w, h) => {}
Demo
License
MIT