JSFiddle - React, Tailwind, and code Playground
Smartphone purchasing channels
by pepperdigital
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 310px; height: 400px; max
JavaScript
Highcharts.chart('container', {
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: 'pie'
},
title: {
text: ''
},
credits: {
enabled: false
},
exporting: {
enabled: false
},
colors: ['#86BC25', '#43B02A', '#046A38', '#0097A9', '#62B5E5',
'#00A3E0', '#0076A8', '#012169', '#2C5234', '#C4D600'],
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
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'
}
}
}
},
series: [{
name: 'Brands',
colorByPoint: true,
size: '60%',
innerSize: '40%',
data: [{
name: 'Online',
y: 40
}, {
name: 'In store',
y: 34,
sliced: true,
selected: true
}, {
name: 'Received from friends/family',
y: 12
}, {
name: 'Over the phone',
y: 9
}, {
name: 'Other',
y: 4
}]
}]
});