JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="chart" style="width:100%;height:480px;"></div>
JavaScript
Highcharts.theme = {
colors: [
'#5e2750',
'#eb9700',
'#007c92',
'#a8b400'
]
};
var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
// Radialize the colors
Highcharts.getOptions().colors = $.map(Highcharts.getOptions().colors, function(color) {
return {
radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
stops: [
[0, color],
//[1, Highcharts.Color(color).brighten(-0.1).get('rgb')] // darken
]
};
});
// Build the chart
var options = {
chart: {
//renderTo: 'chart',
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
backgroundColor: 'transparent',
spacingTop: 0,
spacingLeft: 0,
spacingRight: 0,
spacingBottom: 0,
animation: false,
shadow: false,
type: 'pie'
},
credits: {
enabled: false
},
title: {
text: null
},
tooltip: {
enabled: false,
formatter: function() {
return '<b>' + this.point.name + '</b> : ' + Math.round(this.percentage) + '%';
}
},
plotOptions: {
pie: {
animation: true,
allowPointSelect: false,
dataLabels: {
enabled: true,
//format: '<b style="font-weight:400;font-family:VodafoneBold;">{point.name}</b> {point.y}/{point.total} ({point.percentage:.1f}%)',
formatter: function(){
return '<b style="font-weight:400;font-family:Arial;">' + this.point.name + '</b> ' + this.point.y + '/' + this.point.total + ' (' + this.point.percentage.toFixed(0) + '%)';
},
style: {
"color": "#666",
"fontSize": "18px",
"fontWeight": "400",
"fontFamily": "Arial"
}
},
shadow: false
},
series: {
...