Last active
December 11, 2022 03:56
-
-
Save JenniferFuBook/7ffc671f2c81646d65da2b345232c22d 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 './App.css'; | |
import HighchartsExporting from 'highcharts/modules/exporting'; | |
import HighchartsMore from 'highcharts/highcharts-more'; | |
HighchartsExporting(Highcharts); | |
HighchartsMore(Highcharts); | |
const getOptions = (type) => ({ | |
chart: { | |
type, | |
}, | |
title: { | |
text: _.startCase(`${type} chart`), | |
}, | |
yAxis: { | |
min: 0, | |
max: 100, | |
title: { | |
text: 'Speed', | |
}, | |
}, | |
series: [ | |
{ | |
data: [80], | |
}, | |
], | |
credits: { | |
enabled: false, | |
}, | |
}); | |
function App() { | |
return ( | |
<HighchartsReact highcharts={Highcharts} options={getOptions('gauge')} /> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment