highcharts-react-official
Version:
Official minimal [Highcharts](https://www.highcharts.com/) wrapper for React.
25 lines (22 loc) • 625 B
JSX
import React from 'react'
import HighchartsReact from '../../'
import Highcharts from 'highcharts'
export default class Container extends React.Component {
constructor () {
super()
this.state = { data: [] }
setInterval(() => this.setState({ data: [...Array(3)].map(Math.random) }), 1500)
}
render () {
const cb = function () {}
return (
<div>
<HighchartsReact
highcharts={Highcharts}
options={{ series: [{ data: this.state.data }], chart: { events: { load: cb } } }}
constructorType={'chart'}
/>
</div>
)
}
}