JSFiddle - React, Tailwind, and code Playground
by Laxmikant Dange
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: 310px; height: 400px; max-width: 600px; margin: 0 auto"></div>
JavaScript
$(function (scope,element,attrs) {
$(element).highcharts({
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: 'pie'
},
title: {
text: 'Browser market shares January, 2015 to May, 2015'
},
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,
data: [{
name: "val_1",
y: 56.33
}, {
name: "val_2",
y: 24.03,
sliced: true,
selected: true
}, {
name: "val_3",
y: 10.38
}, {
name: "val_4",
y: 4.77
}, {
name: "val_5",
y: 0.91
}, {
name: "val_6",
y: 0.2
}]
}]
});
});