FusionCharts - Gallery Example - Bar 2D Chart
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>
<!-- Simple implementation of the Bar 2D chart -->
<div id="chart-container">FusionCharts will render here</div>
JavaScript
FusionCharts.ready(function() {
var topStores = new FusionCharts({
type: 'bar2d',
renderAt: 'chart-container',
width: '500',
height: '400',
dataFormat: 'json',
dataSource: {
"chart": {
"theme": "fusion",
"caption": "Top 5 Stores by Sales",
"maxBarHeight": "20",
"subCaption": "Last month",
"yAxisName": "Sales (In USD)",
"numberPrefix": "$",
"alignCaptionWithCanvas": "0",
"showLabels": "0"
},
"data": [{
"label": "Bakersfield Central",
"value": "880000"
},
{
"label": "Garden Groove harbour",
"value": "730000"
},
{
"label": "Los Angeles Topanga",
"value": "590000"
},
{
"label": "Compton-Rancho Dom",
"value": "520000"
},
{
"label": "Daly City",
"value": "330000"
}
],
"annotations": {
"groups": [{
"items": [{
"type": "text",
"text": "Bakersfield Central",
"x": "$dataset.0.set.0.STARTX",
"y": "$dataset.0.set.0.STARTY-15",
"align": "LEFT"
},
{
"type": "text",
"text": "$880000",
"x": "$dataset.0.set.0.ENDX",
"y": "$dataset.0.set.0.STARTY-15",
"align": "RIGHT"
}]
},
{
"items": [{
"type": "text",
"text": "Garden Groove harbour",
"x": "$dataset.0.set.1.STARTX",
"y": "$dataset.0.set.1.STARTY-15",
"align": "LEFT"
},
{
"type": "text",
"text": "$730000",
"x": "$dataset.0.set.1.ENDX",
"y": "$dataset.0.set.1.STARTY-15",
"align": "RIGHT"
...