JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/funnel.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<div id='chart'></div>
JavaScript
$(function(){
$('#chart').highcharts({
chart: {
type: 'funnel',
marginRight: 100
},
title: {
text: 'Song Graph',
x: -50
},
plotOptions: {
series: {
dataLabels: {
enabled: true,
format: '<b>{point.name}</b> ({point.y:,.0f})',
color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black',
softConnector: true
},
neckWidth: '40%',
neckHeight: '18%',
events: {
click: function (event) {
alert("You clicked on " + event.point.name + ". How do I get its ID?"); // this would get 'song_id'
}
}
}
},
legend: {
enabled: false
},
series: [{
name: 'Song Plays',
data: [
['blues',123,'song_1'],
['rock',234,'song_2']
]
}]
});
});