FusionCharts - Pie 2D Chart in Javascript
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/themes/fusioncharts.theme.fint.js"></script>
<!-- Customizing Label Clearance in Pie 2D Chart using attributes:
# labelDistance - set the distance of the label/value text boxes from the pie/doughnut edge. This attribute is applicable only when smart labeling is disabled.
# smartLabelClearance - used to configure the distance of a smart label from the end of the slice. Used in the case when smartlabels are enabled.
-->
<div id="chart-container">FusionCharts will render here</div>
CSS
body div {
float: left;
padding: 0 10px;
}
JavaScript
FusionCharts.ready(function () {
var revenueChart = new FusionCharts({
type: 'pie2d',
renderAt: 'chart-container',
width: '450',
height: '300',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": "Split of revenue by product categories",
"subCaption": "Last year",
"numberPrefix": "$",
"showPercentValues": "1",
"showPercentInTooltip": "0",
"pieRadius": "100",
"decimals": "1",
"enableSmartLabels": "1",
// "skipOverlapLabels":"1",
//Theme
"theme": "fint",
"labelFontSize": "12"
},
"data": [
{
"label": "Food",
"value": "285040"
},
{
"label": "Apparels",
"value": "146330"
},
{
"label": "Electronics",
"value": "145070"
},
{
"label": "Household",
"value": "22100"
},
{
"label": "Baby",
"value": "1000"
},
{
"label": "Sports",
"value": "1400"
},
{
"label": "Bedding",
"value": "1700"
},
{
"label": "Sanitary",
"value": "14000"
},
{
"label": "Kitchen",
"value": "9000"
},
{
"label": "Category1",
"value": "1000"
},
{
"label": "Category2",
...