JSFiddle - React, Tailwind, and code Playground
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: 400px; height: 400px; margin: 0 auto"></div>
JavaScript
$(function() {
// Create the chart
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'pie'
},
title: {
text: ''
},
plotOptions: {
pie: {
shadow: false
}
},
tooltip: {
formatter: function() {
return '<b>'+ this.point.name +'</b>: '+ this.y +' %';
}
},
series: [{
name: 'Items',
data: [["One",6],["Two",4],["Three",7]],
size: '60%',
innerSize: '50%',
showInLegend:true,
dataLabels: {
enabled: true,
softConnector: false
}
}]
}, function(chart){
console.log(chart);
var middleX = chart.plotWidth / 2;
var series = chart.series[0];
var points = series.points;
for (var i = 0; i < points.length; i++){
var dataLabel = points[i].dataLabel;
var posX = dataLabel.x > middleX ? dataLabel.x + 30 : dataLabel.x - 60; chart.renderer.image('http://highcharts.com/demo/gfx/sun.png', posX, dataLabel.y, 50, 50)
.add();
}
// middle image
chart.renderer.image('http://highcharts.com/demo/gfx/sun.png', series.center[0] - 25, series.center[1] - 25, 60, 60)
.add();
});
});