FusionCharts - Pie 2D Chart in Javascript
Created using FusionCharts Suite XT - www.fusioncharts.com
HTML
<script src="https://cdn.fusioncharts.com/fusioncharts/latest/fusioncharts.js"></script>
<script src="https://cdn.fusioncharts.com/fusioncharts/latest/themes/fusioncharts.theme.fusion.js"></script>
<!-- Basic samples for Pie 2D Chart showing split of revenue by product categories for last year.
-->
<div id="chart-container">FusionCharts will render here</div>
CSS
body div {
float: left;
padding: 0 10px;
}
JavaScript
FusionCharts.ready(function() {
var myData = [{
"label": "1",
"value": "1"
},
{
"label": "2",
"value": "2"
}
];
setTimeout(function() {
for(var i=3; i<10; i++) {
myData.push(
{
"label": i.toString(),
"value": i
});
}
}, 1000);
console.log(myData);
var revenueChart = new FusionCharts({
type: 'pie2d',
renderAt: 'chart-container',
width: '550',
height: '350',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": "Split of revenue by product categories",
"subCaption": "Last year",
"numberPrefix": "$",
"showValues": "1",
"showPercentValues": "0",
"decimals": "1",
//Theme
"theme": "fusion"
},
"data": myData
}
}).render();
});