easyJet donut
by Danielle Parkinson
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-width: 600px; margin: 0 auto"></div>
JavaScript
$(function () {
// Radialize the colors
Highcharts.getOptions().colors = Highcharts.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.3).get('rgb')] // darken
]
};
});
// Build the chart
$('#container').highcharts({
chart: {
width: 400,
height: 300,
backgroundColor: '#fff'
},
exporting: { enabled: false },
colors: [
'#D72428',
'#e5e5e5',
'#b1b1b1'
],
credits: {
enabled: false
},
title: {
text: ' '
},
tooltip: {
pointFormat: '{point.percentage:.1f}%'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
innerSize: '78%',
borderWidth: 0,
dataLabels: {
enabled: false,
format: '{point.percentage:.0f}%',
connectorWidth: 0,
distance: -50,
style: {
color: '#73879c',
fontSize: '12px',
fontWeight: 'normal',
fontFamily: 'Arial',
textOutline: false
}
},
showInLegend: true
}
},
legend: {
enabled: true,
itemStyle: {
color: '#2e2e2e',
fontWeight: 'normal',
fontFamily: 'Open Sans',
fontSize: '13px',
textAlign: 'center'
},
layout: 'horizontal'
},
series: [{
type: 'pie',
name: 'Browser...