Skip to content

Instantly share code, notes, and snippets.

@JenniferFuBook
Last active April 8, 2023 03:21
Show Gist options
  • Save JenniferFuBook/dc8f344402668ef35ac6d225e127aba5 to your computer and use it in GitHub Desktop.
Save JenniferFuBook/dc8f344402668ef35ac6d225e127aba5 to your computer and use it in GitHub Desktop.
import Highcharts from 'highcharts';
import HighchartsReact from 'highcharts-react-official';
import HighchartsExporting from 'highcharts/modules/exporting';
import HighchartsAccessibility from 'highcharts/modules/accessibility';
import HighchartsParallelCoordinates from 'highcharts/modules/parallel-coordinates';
HighchartsExporting(Highcharts);
HighchartsAccessibility(Highcharts);
HighchartsParallelCoordinates(Highcharts);
const data = [
[0, 0],
[1, 10],
[2, 20],
[3, 30],
[4, 40],
];
const getOptions = () => ({
chart: {
type: 'line',
width: 800,
height: 600,
parallelCoordinates: true,
parallelAxes: {
lineWidth: 2,
},
},
title: {
text: 'Parallel Coordinates Chart',
},
xAxis: {
categories: ['Values 1', 'Values 2'],
offset: 10,
},
yAxis: [
{
type: 'linear',
min: 0,
max: 4,
},
{
type: 'linear',
min: 0,
max: 40,
},
],
series: data.map((set, i) => ({
name: `Line ${i}`,
data: set,
lineWidth: 10,
})),
credits: {
enabled: false,
},
});
function App() {
return <HighchartsReact highcharts={Highcharts} options={getOptions()} />;
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment