FusionCharts - Gallery Example - Horizontal Bullet
Created using FusionCharts Suite XT - www.fusioncharts.com
by FusionCharts
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>
<!-- Horizontal Bullet chart -->
<div id="chart-container">FusionCharts will render here</div>
JavaScript
FusionCharts.ready(function() {
var revComp = new FusionCharts({
type: 'hbullet',
renderAt: 'chart-container',
width: '500',
height: '100',
dataFormat: 'json',
dataSource: {
"chart": {
"theme": "fusion",
"lowerLimit": "0",
"subCaptionFontSize": "11",
"upperLimit": "120",
"caption": "Last Month Revenue",
"subcaption": "Actual vs Target (Bakersfield Central)",
"numberPrefix": "$",
"numberSuffix": "K",
"chartBottomMargin": "25",
"captionPadding": "7"
},
"colorRange": {
"color": [{
"minValue": "0",
"maxValue": "50",
"code": "#e44a00",
"alpha": "25"
}, {
"minValue": "50",
"maxValue": "75",
"code": "#f8bd19",
"alpha": "25"
}, {
"minValue": "75",
"maxValue": "120",
"code": "#6baa01",
"alpha": "25"
}]
},
"value": "82",
"target": "90"
},
events: {
'beforeRender': function(event, args) {
var container = document.createElement("div"),
sender = event.sender;
container.setAttribute("id", "checkbox-container");
container.innerHTML = '<input type="checkbox" id="tmCB" checked>Show Tick Mark?</input><input type="checkbox" id="tvCB" checked>Show Tick Value?</input><input type="checkbox" id="tpCB">Tick On Top?</input>';
args.container.parentNode.insertBefore(container, args.container.nextSibling);
var tickmarkCB = document.getElementById("tmCB"),
tickvalueCB = document.getElementById("tvCB"),
tickposCB = document.getElementById("tpCB");
//Function to show/hide tick mark
function showTickMark(evt, obj) {
//Using showTickMarks attribute to show/hide ticks
...