Highcharts Demo
author(s):
Torstein Hønsi
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
// Build the chart
Highcharts.chart('container', {
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: 'pie'
},
title: '',
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
lang: {
yourKey: "Custom button tooltip text",
myKey:"Bad Store"
},
exporting: {
buttons: {
contextButton: {
enabled: false
},
exportButton: {
text: `Chrome`,
_titleKey: "yourKey",
onclick:function(){
alert('clicked Chrome');
},
x:-410
},
printButton: {
enabled: false,
text: `IE: `,
_titleKey:"myKey",
onclick: function () {
alert('clicked IE');
},
x:-400,
y:30
},
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: false
},
showInLegend: true
}
},
series: [{
name: 'Brands',
colorByPoint: true,
data: [{
name: 'Chrome',
y: 61.41,
sliced: true,
selected: true
}, {
name: 'Internet Explorer',
y: 11.84
}]
}]
});