Highcharts Demo
author(s):
Torstein Hønsi
by Himanshu Joshi
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'
},
plotOptions: {
pie: {
borderColor: '#000000',
innerSize: '60%'
}
},
series: [{
data: [
['Firefox', 44.2],
['IE7', 26.6],
['IE6', 20],
['Chrome', 3.1],
['Other', 5.4]
]}]
},
// using
function(chart) { // on complete
var xpos = '50%';
var ypos = '55%';
var circleradius = 102;
// Render the circle
chart.renderer.circle(xpos, ypos, circleradius).attr({
fill: '#ddd',
}).add();
// Render the text
chart.renderer.text('<div style="width:300px;"><span style="font-weight:normal;font-color:C2D6D6;">Revenue</span><div style="font-weight:bold;font-size: 40px;font-color:#ffff;position:relative;top:10px;">701k</div></div>', 215, 215).css({
//width: 100,
//color: '#4572A7',
//fontSize: '16px',
//textAlign: 'center'
}).attr({
// why doesn't zIndex get the text in front of the chart?
// zIndex: 999
}).add();
});
});