Empty
by Kondal Durgam
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 400px; width: 500px"></div>
JavaScript
$(function() {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'pie'
},
credits: {
enabled: false
},
exporting: {
enabled: false
},
title: {
text: 'MOBILIZATION SOURCE',
},
colors: ['#1b3264', '#5bc7ff', '#5b8eff', '#135af4'],
plotOptions: {
pie: {
borderColor: '#000000',
innerSize: '70%',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f} %',
style: {
color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
}
}
}
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
series: [{
name: 'Source',
data: [
['Pysical visit', 59],
['Call centre', 31],
['Mela', 9],
['Self', 2]
]
}]
},
// using
function(chart) { // on complete
var xpos = '50%';
var ypos = '53%';
var circleradius = 102;
// Render the circl
// Render the text
chart.renderer.text('<span style="color: black">Total<br>39000 </span>', 225, 225).css({
width: circleradius * 2,
color: '#red',
fontSize: '16px',
textAlign: 'center'
}).attr({
// why doesn't zIndex get the text in front of the chart?
zIndex: 999
}).add();
});
});