16.1.0 • Published 5 years ago

react-highcharts v16.1.0

Weekly downloads
36,942
License
-
Repository
github
Last release
5 years ago

react-highcharts

Build Status

Highcharts 6.x.x component for react. For highcharts 5.x.x use v. 13.0.0

Demos

react-highcharts | react-highcharts/more | react-highcharts/highstock | react-highcharts/highmaps

You can also see Code for the demo and run demo locally

Installation

npm install react-highcharts --save

Usage

Webpack/Browserify

npm install react-highcharts highcharts react --save
const React = require('react');
const ReactDOM = require('react-dom');

const ReactHighcharts = require('react-highcharts'); // Expects that Highcharts was loaded in the code.

const config = {
  /* HighchartsConfig */
};

ReactDOM.render(<ReactHighcharts config = {config}></ReactHighcharts>, document.body);

Optional after-render callback

const afterRender = (chart) => { /* do stuff with the chart  */ };
<ReactHighcharts config = {config} callback = {afterRender}></ReactHighcharts>

Passing properties to the wrapping DOM element

<ReactHighcharts config = {config} domProps = {{id: 'chartId'}}></ReactHighcharts>

Accessing Highcharts API After Render

For access to methods & properties from the Highcharts library you can use ReactHighcharts.Highcharts. For example, the Highcharts options are available via ReactHighcharts.Highcharts.getOptions().

Highcharts provides an API for manipulating a chart after the initial render. See the Methods and Properties in the documentation. Here's how you access it:

class MyComponent extends React.Component {
  componentDidMount() {
    let chart = this.refs.chart.getChart();
    chart.series[0].addPoint({x: 10, y: 12});
  }

  render() {
    return <ReactHighcharts config={config} ref="chart"></ReactHighcharts>;
  }
}

Limiting Highchart Rerenders

Rerendering a highcharts graph is expensive. You can pass in a isPureConfig option to the ReactHighcharts component, which will keep the highcharts graph from being updated so long as the provided config is referentially equal to its previous value. There is also neverReflow property.

Rendering on the server with node

See this recipe

Using highmaps (demo)

const ReactHighmaps = require('react-highcharts/ReactHighmaps');

Using highstock (demo)

const ReactHighstock = require('react-highcharts/ReactHighstock')

Using highcharts modules/add-ons like exporting, data, etc. (demo)

Use highcharts-more npm package.

const ReactHighcharts = require('react-highcharts')
require('highcharts-more')(ReactHighcharts.Highcharts)

You can find the full list here

Passing Highcharts instance manually

const ReactHighcharts = require('react-highcharts').withHighcharts(ReactHighstock)

For Contributors

Running tests

Run npm test

Running demo

git clone https://github.com/kirjs/react-highcharts.git
cd react-highcharts && npm install
npm run demo

Point your browser at http://localhost:8080

demo-npm-plugincrypticcoin-walletcrypticcoin-wallet-testhotee-admin@infinitebrahmanuniverse/nolb-react-hi@mediatool/mt-reporting-ui@everything-registry/sub-chunk-2559dr-cash-frontendfront-affilatetc-components-v2wes-coreuisalido-uirm-coreuisubhojit777_surveymidas-coreuimozaik-ext-harshmontecarlowidgetlwj-easy-report-frontendmarket-forecastorion-uionespot-dashboard-prototypepp365-portfoliowebpartspp365-programpp365-programwebpartspower-ui-componentsnrcreact-layout-systemqsq-ui-reactradmin-projectrd-te-dashboardrd-te-examplerd-te-invoicerd-te-quotesrd-te-quotingrd-te-reportsrd-te-shipmentsrd-te-stylesq-base-chartreact-informerreact-highchart-themeq-react-highchartsummarywidgetrodericrts-react-componentsrts-react-components-developmentsingle-cell-expression-atlas-tsne-plottradebase@attivio/suit@alixpartners/ui-components@bufferapp/audience-chart@bufferapp/audience-comparison-chart@bufferapp/analyze-shared-components@bufferapp/comments-comparison-chart@bufferapp/compare-chart@bufferapp/comparison-chart@bufferapp/contextual-compare@bufferapp/demographic-cities@bufferapp/demographic-countries@bufferapp/demographic-gender-age@bufferapp/engagement-comparison-chart@bufferapp/feedback@bufferapp/likes-comparison-chart@bufferapp/reach-comparison-chart@bufferapp/shopify-products@bufferapp/shopify-sources@bufferapp/stories-daily@bufferapp/stories-metrics@actonate/mirkwood-rxyang-coreui@ebi-gene-expression-group/expression-atlas-experiment-page@ebi-gene-expression-group/expression-atlas-heatmap-highcharts@icedesign/builder-platfrom-scaffold@icedesign/multiple-pie-chart-block@icedesign/pareto-chart-block@icedesign/real-time-data-block@gatsbyjs/gatsby-theme-website@informatics-scotland/informatics-suit@informer/react@ndustrial/nd-react-charting@procore/labs-highchart-visuals@realty-mogul/rm-coreui@sisu-llc/pki-suit@zinier/platform-componentsJSErrorMonitorabr-npm-5-test-2astroffersantd-adminactionstepswidgetamap-reusable-widgetsaugur-clientaugur-ui-react-componentsbancor-walletbbd-ui-componentsbeidou-example-antd-admincge-app-modulesdec-controlsexpression-atlas-experiment-pageexpression-atlas-experiment-page-tsne-plotexpression-atlas-heatmap-highchartsexpression-atlas-tsne-plot
16.1.0

5 years ago

16.0.2

7 years ago

16.0.1

7 years ago

16.0.0

7 years ago

15.0.0

7 years ago

13.0.0

7 years ago

12.0.0

8 years ago

11.5.0

8 years ago

11.0.0

8 years ago

10.0.0

8 years ago

9.0.0

8 years ago

8.4.2

8 years ago

8.4.1

8 years ago

8.4.0

8 years ago

8.3.3

8 years ago

8.3.2

9 years ago

8.3.1

9 years ago

8.3.0

9 years ago

8.2.0

9 years ago

8.1.1

9 years ago

8.1.0

9 years ago

8.0.3

9 years ago

8.0.2

9 years ago

8.0.0

9 years ago

7.0.0

9 years ago

6.0.1

9 years ago

6.0.0

9 years ago

5.0.6

9 years ago

5.0.4

9 years ago

5.0.3

9 years ago

5.0.2

9 years ago

5.0.0

9 years ago

4.0.0

9 years ago

3.0.0

9 years ago

2.1.0

9 years ago

2.0.0

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

1.0.0

10 years ago