JSFiddle - React, Tailwind, and code Playground
by Purva Kshatriya
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<script src="http://code.highcharts.com/highcharts-3d.js"></script>
<div id="container" style="margin: 0 auto"></div>
JavaScript
$(function () {//Pie chart
$('#container').highcharts({
chart:{
type:'pie',
height:350,
width:500,
borderRadius:0,
borderWidth: 0,
plotBorderWidth:0
},
title: {
text: 'Browser market shares at a specific website, 2014'
},
legend:{
enabled:true,
layout:'horizontal',
verticalAlign:'bottom',
borderWidth:0,
backgroundColor:null
},
tooltip: {
enabled:true,
pointFormat: '{series.name}: <i>{point.y}</i>',
borderWidth:1,
borderRadius:2
},
plotOptions: {
pie: {
animation:false,
showInLegend: true,
dataLabels: {
enabled: true,
rotation:0,
connectorWidth:1,
format:'{point.name}: {point.y}',
softConnector:false,
connectorColor:'blue',
borderRadius: 5,
backgroundColor: 'rgba(252, 255, 197, 0.7)',
borderWidth: 1,
borderColor: '#AAA'
}
},
series:{
point: {
events: {
legendItemClick: function () {
return false; // <== returning false will cancel the default action
}
}
}
}
},
series: [
{
type: 'pie',
name: 'Browser share',
data: [
['Firefox', 45.0],
['IE', 26.8],
['Chrome', 12.8],
['Safari', 8.5],
['Opera', 6.2],
['Others', 0.7]
...