Highcharts Demo
author(s): Torstein Hønsi
by prathik
HTML
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<div id="container" style="min-width: 310px; height: 400px; max-width: 600px; margin: 0 auto"></div>
JavaScript
Highcharts.chart('container', {
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: 'pie'
},
title: {
text: 'Browser market shares in January, 2018'
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
cursor: 'pointer',
dataLabels: {
enabled: false
}
}
},
series: [
{
id: 'brands',
name: 'Brands',
size: "85%",
//innerSize: "56.67%",
showInLegend: true,
point: {
events: {
legendItemClick: function() {
this.series.chart.series[1].points[this.index].setVisible(!this.visible, true);
}
}
},
data: [{
name: 'Chrome',
y: 61.41
}, {
name: 'Internet Explorer',
y: 11.84
}, {
name: 'Firefox',
y: 10.85
}, {
name: 'Edge',
y: 4.67
}, {
name: 'Safari',
y: 4.18
}, {
name: 'Other',
y: 7.05
}]
},
{
linkedTo: 'brands',
name: 'Brands2',
size: "56.67%",
//innerSize: "28.3%",
data: [{
name: 'Chrome',
y: 21.41
}, {
name: 'Internet Explorer',
y: 47.84
}, {
name: 'Firefox',
y: 90.85
}, {
name: 'Edge',
y: 49.67
}, {
name: 'Safari',
y: 104.18
}, {
name: 'Other',
y: 17.05
}]
},
{
//linkedTo: 'brands2',
name: 'Brands3',
size: "28.3%",
data: [{
name: 'Chrome',
y: 21.41
}, {
name: 'Internet Explorer',
y: 47.84
}, {
name: 'Firefox',
y: 90.85
}, {
name: 'Edge',
y: 49.67
}, {
name: 'Safari',
y: 104.18
}, {
name: 'Other',
y: 17.05
}]
}]
});