/
HighChart.react.js
38 lines (38 loc) · 1.03 KB
/
HighChart.react.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import HighchartsReact from 'highcharts-react-official';
/**
* HighChart renders Highcharts.js JSON
*/
export default class HighChart extends Component {
render() {
const {constructorType, options} = this.props;
return (
<HighchartsReact
highcharts={window.Highcharts}
options={options}
constructorType={constructorType}
/>
);
}
}
HighChart.defaultProps = {};
HighChart.propTypes = {
/**
* The ID used to identify this component in Dash callbacks.
*/
id: PropTypes.string,
/**
* 'chart', 'stockChart', 'mapChart', 'ganttChart'
*/
constructorType: PropTypes.string,
/**
* The highcharts chart description
*/
options: PropTypes.object,
/**
* Dash-assigned callback that should be called to report property changes
* to Dash, to make them available for callbacks.
*/
setProps: PropTypes.func
};