FusionCharts - 2D look and feel in Bulb Gauge
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>
<!--
2D look and feel in Bulb Gauge.
Attributes :
# is3D - Set to 0
-->
<div id="chart-container">FusionCharts will render here</div>
CSS
#headerdiv {
font-family: "Arial", "Helvetica";
font-size: 13px;
font-weight: bold;
}
#valueDiv {
color: #EEEEEE;
text-align: center;
font-size: 25px;
padding: 10px;
margin-top: 5px;
font-family: "Arial", "Helvetica";
font-weight: bold;
}
JavaScript
FusionCharts.ready(function() {
var salesChart = new FusionCharts({
type: 'bulb',
renderAt: 'chart-container',
id: 'myChart',
width: '300',
height: '300',
dataFormat: 'json',
dataSource: {
"chart": {
"theme": "fusion",
"caption": "Temperature status of deep freezers",
"upperlimit": "-5",
"lowerlimit": "-60",
"captionPadding": "30",
"showshadow": "0",
"showvalue": "1",
"useColorNameAsValue": "1",
"placeValuesInside": "1",
"valueFontSize": "16",
//2D look n feel
"is3D": "0",
//Theme
"theme": "fusion"
},
"colorrange": {
"color": [{
"minvalue": "-60",
"maxvalue": "-35",
"label": "Mission control, <br> we have a situation!",
"code": "#ff0000"
},
{
"minvalue": "-35",
"maxvalue": "-25",
"label": "Something is just not right!",
"code": "#ff9900"
},
{
"minvalue": "-25",
"maxvalue": "-5",
"label": "All well ahoy!",
"code": "#00ff00"
}
]
},
"value": "-5"
},
"events": {
"rendered": function(evtObj, argObj) {
setInterval(function() {
var num = (Math.floor(Math.random() * 55) * -1) - 5;
FusionCharts("myChart").feedData("&value=" + num);
}, 10000);
}
}
});
salesChart.render();
});