Skip to content

Instantly share code, notes, and snippets.

@JenniferFuBook
Last active December 13, 2022 06:04
Show Gist options
  • Save JenniferFuBook/b34dc81945f36bbb688ebf5737977400 to your computer and use it in GitHub Desktop.
Save JenniferFuBook/b34dc81945f36bbb688ebf5737977400 to your computer and use it in GitHub Desktop.
import Highcharts from 'highcharts';
import HighchartsReact from 'highcharts-react-official';
import _ from 'lodash';
import HighchartsExporting from 'highcharts/modules/exporting';
import HighchartsAccessibility from 'highcharts/modules/accessibility';
import HighchartsMore from 'highcharts/highcharts-more';
HighchartsExporting(Highcharts);
HighchartsAccessibility(Highcharts);
HighchartsMore(Highcharts);
const getOptions = (type) => ({
chart: {
type,
width: 800,
height: 600,
},
title: {
text: _.startCase(`${type} chart`),
},
yAxis: {
title: {
text: 'Dimension',
},
},
series: [
{
data: [[0, 2, 10], [1, 2, 20], [2, 1, 30], [3, 4, 40], [4, 3, 50], [5, 2, 60]],
},
{
data: [[0, 4, 100], [1, 3, 100], [2, 6, 100], [3, 5, 100], [4, 4, 100], [5, 6, 100]],
},
{
data: [[0, 5, 200], [1, 7, 20], [2, 7, 200], [3, 6, 20], [4, 7, 200], [5, 7, 20]],
},
],
credits: {
enabled: false,
},
});
function App() {
return (
<HighchartsReact highcharts={Highcharts} options={getOptions('bubble')} />
);
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment