Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JenniferFuBook/c2aeef61c40820c7dead2f41037b6908 to your computer and use it in GitHub Desktop.
Save JenniferFuBook/c2aeef61c40820c7dead2f41037b6908 to your computer and use it in GitHub Desktop.
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