JSFiddle - React, Tailwind, and code Playground
by Valentin Radulescu
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 310px; height: 400px; max-width: 600px; margin: 0 auto"></div>
JavaScript
$(function () {
$('#container').highcharts({
chart: {
type: 'pie'
},
title: {
text: 'Pie Chart With Visualization I'
},
legend: {
align: 'bottom',
symbolWidth: 10,
symbolHeight: 10,
symbolPadding: 10,
symbolRadius: 5
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f} %',
style: {
color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
}
},
showInLegend: true
}
},
series: [{
data: [
['English', 45],
['French', 35],
['German', 20]
]
}]
});
});