Last active
December 19, 2022 05:43
-
-
Save JenniferFuBook/6ac852b41a21fe70b484684e998ba64f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Highcharts from 'highcharts'; | |
| import HighchartsReact from 'highcharts-react-official'; | |
| import _ from 'lodash'; | |
| import Highcharts3D from 'highcharts/highcharts-3d'; | |
| import HighchartsExporting from 'highcharts/modules/exporting'; | |
| import HighchartsAccessibility from 'highcharts/modules/accessibility'; | |
| import HighchartsCylinder from 'highcharts/modules/cylinder'; | |
| Highcharts3D(Highcharts); | |
| HighchartsExporting(Highcharts); | |
| HighchartsAccessibility(Highcharts); | |
| HighchartsCylinder(Highcharts); | |
| const getOptions = (type) => ({ | |
| chart: { | |
| type, | |
| width: 800, | |
| height: 600, | |
| }, | |
| title: { | |
| text: _.startCase(`${type} chart`), | |
| }, | |
| xAxis: { | |
| categories: ['A', 'B', 'C', 'D', 'E', 'F'], | |
| }, | |
| series: [ | |
| { | |
| name: 'Group 1', | |
| data: [0, 3, 5, 5, 6, 2], | |
| }, | |
| { | |
| name: 'Group 2', | |
| data: [0, 1, 3, 6, 1, 9], | |
| }, | |
| { | |
| name: 'Group 3', | |
| data: [1, 2, 5, 4, 9, 11], | |
| }, | |
| { | |
| name: 'Group 4', | |
| data: [1, 3, 2, 8, 7, 5], | |
| }, | |
| ], | |
| credits: { | |
| enabled: false, | |
| }, | |
| }); | |
| function App() { | |
| return ( | |
| <HighchartsReact highcharts={Highcharts} options={getOptions('cylinder')} /> | |
| ); | |
| } | |
| export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment