Caption with background color-247593
Created using FusionCharts Suite XT - www.fusioncharts.com
by Nabajeet Sonowal
HTML
<script src="http://static.fusioncharts.com/code/latest/fusioncharts.charts.js"></script>
<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>
<!--$captionStartX, $captionStartY, $captionEndX, $captionEndY, $captionWidth, $captionHeight, $subCaptionStartX, $subCaptionStartY, $subCaptionEndX, $subCaptionEndY, $subCaptionWidth, $subCaptionHeight Annotations can be positioned relative to chart caption and subcaption using these macros.-->
<div id="chart-container">FusionCharts will render here</div>
CSS
body {
padding: 10px;
}
JavaScript
FusionCharts.ready(function () {
var revenueChart = new FusionCharts({
type: 'column2d',
renderAt: 'chart-container',
width: '500',
height: '300',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": "Monthly Revenue",
"captionBgColor": "#ff0000",
"subCaption": "Last year",
"xAxisName": "Month",
"yAxisName": "Amount (In USD)",
"numberPrefix": "$",
//Theme
"theme": "fint"
},
"annotations": {
"groups": [{
"id": "total-label",
"items": [{
"id": "total-label-bg",
"type": "rectangle",
"radius": "3",
"x": "$captionStartX",
"y": "$captionStartY",
"toX": "$captionEndX",
"toY": "$captionEndY",
"fillColor": "#0075c2",
"alpha": "70"
}]
}]
},
"data": [{
"label": "Jan",
"value": "420000"
}, {
"label": "Feb",
"value": "810000"
}, {
"label": "Mar",
"value": "720000"
}, {
"label": "Apr",
"value": "550000"
}, {
"label": "May",
"value": "910000"
}, {
"label": "Jun",
"value": "510000"
}, {
"label": "Jul",
"value": "680000"
}, {
"label": "Aug",
"value": "620000"
}, {
"label": "Sep",
...