2.0.1 • Published 5 years ago

react-highcharts-v5 v2.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

react-highcharts-v5

React.js(v16.x+) component wrap for HighCharts.js(v6.x+)

Installation

$ npm install --save highcharts react-highcharts-v5

Usage

  1. 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')]
          }
  2. Import HighCharts

    import IHighCharts from 'react-highcharts-v5/src/HighCharts.js';
    
    export default () => {
      const options = {};
    
      return (
        <IHighCharts
          options={options}
        />
      );
    };
  3. Import HighMaps

    import IHighCharts from 'react-highcharts-v5/src/HighMaps.js';
    
    export default () => {
      const options = {};
    
      return (
        <IHighCharts
          options={options}
        />
      );
    };
  4. 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

react-highcharts-v5-demo

License

MIT

2.0.1

5 years ago

2.0.0

5 years ago

1.0.8

5 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago