Skip to content

Instantly share code, notes, and snippets.

@JenniferFuBook
Last active December 11, 2022 03:56
Show Gist options
  • Save JenniferFuBook/7ffc671f2c81646d65da2b345232c22d to your computer and use it in GitHub Desktop.
Save JenniferFuBook/7ffc671f2c81646d65da2b345232c22d to your computer and use it in GitHub Desktop.
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