FusionCharts - Dynamic center Labels in Doughnut 2D Chart
Created using FusionCharts Suite XT - www.fusioncharts.com
by Gagan Sikri
HTML
<script src="http://static.fusioncharts.com/code/latest/fusioncharts.js"></script>
<script src="http://static.fusioncharts.com/code/latest/themes/fusioncharts.theme.fint.js"></script>
<!-- Showcased in this doughnut chart:
- Center label available in 2D doughnut chart, which lets you show additional info on the chart.
- Hover on doughnut slices to see additional data for each plot in centerLabel.
- Tooltips are disabled
Attributes:
1. defaultCenterLabel
2. centerLabel
-->
<div id="chart-container">FusionCharts will render here</div>
JavaScript
FusionCharts.ready(function () {
var revenueChart = new FusionCharts({
type: 'doughnut2d',
renderAt: 'chart-container',
width: '500',
height: '400',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": "Split of Revenue by Product Categories",
"subCaption": "Los Angeles Topanga - Last month",
"numberPrefix": "$",
"pieRadius": "100",
"startingAngle": "310",
"decimals": "0",
"defaultCenterLabel": "Total revenue: $60K",
"centerLabel": "Revenue from $label: $value",
"theme": "fint",
"showHoverEffect": "0",
"animation": "0",
"enableSmartLabels": "0",
"labelDistance": "-10",
},
"data": [{
"label": "Food",
"value": "28504"
}, {
"label": "Apparels",
"value": "14633"
}, {
"label": "Electronics",
"value": "10507"
}, {
"label": "Household",
"value": "4910"
}]
}
}).render();
});