JSFiddle - React, Tailwind, and code Playground
by Black Label
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/sankey.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="container"></div>
CSS
#container {
min-width: 300px;
max-width: 800px;
height: 400px;
margin: 1em auto;
border: 1px solid silver;
}
#csv {
display: none;
}
JavaScript
Highcharts.chart('container', {
chart: {
showAxes: true,
events: {
load: function() {
var max = this.series[0].nodeColumns.length - 2;
this.xAxis[0].update({
max: max
})
}
}
},
title: {
text: ''
},
xAxis: {
type: "category",
max: 0,
categories: ['Semi-Final', '', 'Final Phase'],
labels: {
x: 10,
y: 30,
style: {
color: 'black'
}
},
lineColor: 'transparent',
tickLength: 0
},
yAxis: {
visible: false
},
series: [{
keys: ['from', 'to', 'weight'],
data: [
['Football', 'Cricket', 20 ],
['Football', 'ronaldo', 3 ],
],
type: 'sankey',
name: 'Sankey demo series'
}]
});