Last active
December 28, 2022 05:42
-
-
Save JenniferFuBook/6974124fbb09dc4b673f1f406dab1502 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 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, 30], | |
[2, 45], | |
[4, 20], | |
[5, 33], | |
[6, 60], | |
[8, 73], | |
[9, 80], | |
]; | |
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: 10, | |
startOnTick: false, | |
reversed: true, | |
}, | |
{ | |
type: 'linear', | |
min: 10, | |
max: 100, | |
startOnTick: false, | |
reversed: true, | |
}, | |
], | |
series: data.map((set, i) => ({ | |
name: `Line ${i}`, | |
data: set, | |
})), | |
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