FusionCharts - Gallery Example - Doughnut 2D Chart
Created using FusionCharts Suite XT - www.fusioncharts.com
HTML
<script src="http://static.fusioncharts.com/code/latest/fusioncharts.js"></script>
<script src="http://static.fusioncharts.com/code/latest/fusioncharts.charts.js"></script>
<!-- Doughnut chart example with:
# Center label in 2D chart
# Disabled tool-tips are disabled, but extended center label info on hover
-->
<div id="chart-container">FusionCharts will render here</div>
<div id="overlaydiv"></div>
<div id="overlaydivtop"></div>
CSS
body {
padding: 5px;
margin: 0 auto;
}
#chart-container {
position: absolute;
top: 0;
right: 0; bottom: 0;
left: 0;
margin-top: 0px;
width: 600px;
height: 600px;
z-index: 0;
}
#overlaydiv {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
padding : 0px;
width: 600px;
height: 600px;
border: 0px solid black;
z-index: 1;
}
#overlaydivtop {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
padding : 0px;
width: 600px;
height: 600px;
border: 0px solid black;
z-index: 2;
}
JavaScript
FusionCharts.ready(function () {
var revenueChart = new FusionCharts({
type: 'doughnut2d',
renderAt: 'chart-container',
width: '600',
height: '600',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": "POWER CONSUMPTION(UNITS)",
"captionFontSize": "20",
"defaultCenterLabel": "Power Units",
"centerLabelFontSize": "18",
"paletteColors": "#86b300,#b3ffb3",
"bgAlpha": "0",
"showBorder": "0",
"showLabels":"0",
"showLegend": "0",
"showValues": "0",
"use3DLighting": "0",
"startingAngle": "90",
"legendShadow": "0",
"enableSmartLabels":"0",
"showTooltip": "0",
"captionFontSize": "14",
"subcaptionFontSize": "14",
"subcaptionFontBold": "0",
"pieRadius": "100",
"doughnutRadius":"70"
},
"data": [
{
"label": "Food",
"value": "47"
},
{
"label": "Apparels",
"value": "53"
}
],
"annotations": {
"drawImmediately": "1",
"showbelow": "1",
"groups": [
{
"id": "Callout",
"items": [
{
"id": "CalloutBase",
"type": "rectangle",
"fillColor": "#86b300",
"x": "25",
"y": "350",
...