Skip to content

Add Reflow and Loading support

Choose a tag to compare

@whawker whawker released this 03 Dec 19:45
· 779 commits to master since this release

New features

Loading component

Added a <Loading /> component to display a message while awaiting for some task to complete (#30). See example

Reflow (via callback)

Added support for reflow via a new callback prop (#43). See example

The callback prop expects a function, which will be called with the Highcharts chart object once the chart is created.

Example
getChart = chart => {
  this.chart = chart;
}

render () {
  return (
    <HighchartsChart callback={this.getChart}>
      // omitted...
    </HighchartsChart>
  );
}

Reflow could then be achieved by adding a function which interacts with the chart object directly.

// Extending the above example
resize = () => {
  this.chart.reflow();
}

This pattern could also be used to utilize Highcharts features not yet supported by React JSX Highcharts, like printing or exporting.