Created
April 8, 2023 04:24
-
-
Save JenniferFuBook/c2aeef61c40820c7dead2f41037b6908 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'; | |
const getOptions = (type) => ({ | |
chart: { | |
type, | |
width: 500, | |
height: 300, | |
}, | |
title: { | |
text: _.startCase(`${type} chart`), | |
}, | |
yAxis: { | |
title: { | |
text: 'Values', | |
}, | |
}, | |
plotOptions: { | |
series: { | |
lineWidth: 10, | |
}, | |
}, | |
series: [ | |
{ | |
data: [0, 0, 0, 0, 0, 0], | |
}, | |
{ | |
data: [7, 7, 7, 7, 7, 7], | |
}, | |
], | |
credits: { | |
enabled: false, | |
}, | |
}); | |
function App() { | |
return ( | |
<div> | |
<HighchartsReact highcharts={Highcharts} options={getOptions('line')} /> | |
</div> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment