Highcharts Demo
author(s): Torstein Hønsi
by supertrue
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container"></div>
JavaScript
$(function() {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'pie'
},
plotOptions: {
pie: {
innerSize: '60%'
}
},
series: [{
data: [
['Firefox', 44.2],
['IE7', 26.6],
['IE6', 20],
['Chrome', 3.1],
['Other', 5.4]
]}]
},
function(chart) { // on complete
var xpos = '50%';
var ypos = '50%';
var circleradius = 100;
// Render the circle
chart.renderer.circle(xpos, ypos, circleradius).attr({
fill: '#ddd',
}).add();
// Render the text
chart.renderer.text('This text should be in the center of the donut', xpos, ypos ).css({
width: circleradius*2,
color: 'red',
textAlign: 'center'
}).attr({
zIndex: 999
}).add();
});
});