Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React JSX Highcharts - Version 2 #35

Merged
merged 20 commits into from
Oct 16, 2017
Merged

React JSX Highcharts - Version 2 #35

merged 20 commits into from
Oct 16, 2017

Conversation

whawker
Copy link
Owner

@whawker whawker commented Oct 15, 2017

Introduces a new HOC withHighcharts to inject the Highcharts object/variant you want to use.

This allows you to use Highcharts in styled mode (style by CSS #20), or perform customisations to the Highcharts object before using it.

The withHighcharts HOC can be used at the chart component level, or at the root level of your application (like Provider from react-redux).

Example 1 - Component Level

import { withHighcharts, HighchartsChart, Chart, /* etc... */ } from 'react-jsx-highcharts';
import Highcharts from 'highcharts/js/highcharts'; // Highcharts styled mode

const MyChart = ({ data }) => (
  <HighchartsChart>
    <Chart />
    // etc
  </HighchartsChart>
);

export default withHighcharts(MyChart, Highcharts);

Example 2 - At application root

import { withHighcharts } from 'react-jsx-highcharts';
import Highcharts from 'highcharts/highstock'; // Highstock

const App = () => (
  <div>
    <Header />
    // etc
  </div>
);

export default withHighcharts(App, Highcharts);

@whawker whawker merged commit c51ec0e into master Oct 16, 2017
@whawker whawker deleted the v2 branch November 28, 2017 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant