FusionCharts - Angular Gauge Configuring Lower & Upper Limit Display
Created using FusionCharts Suite XT - www.fusioncharts.com
HTML
<script src="http://static.fusioncharts.com/code/latest/fusioncharts.js"></script>
<script src="http://static.fusioncharts.com/code/latest/fusioncharts.widgets.js"></script>
<script src="http://static.fusioncharts.com/code/latest/themes/fusioncharts.theme.fint.js"></script>
<!-- Showcase of Customer Satisfaction Score for current week using Angular Gauge. Configuring the Lower and Upper limit as specific texts.
Attributes:
#. lowerLimitDisplay - set to Bad
#. upperLimitDisplay - set to Good
-->
<div id="chart-container">FusionCharts will render here</div>
<div>
<div>
<div id="header">
<div class="parameter-name">Parameter Name</div>
<div class="parameter-value">Parameter Value</div>
</div>
<div id="attrs-table"></div>
</div>
</div>
CSS
body {
padding: 5px;
margin: 0 auto;
}
#header {
display: none;
}
#indicatorDiv {
width: 500px;
font-family:'Arial', 'Helvetica';
font-size: 14px;
}
p {
margin-top: 20px;
margin-bottom: 20px;
}
#attrs-table {
text-align: center;
width: 500px;
}
.parameter-name, .parameter-value {
width: 250px;
font-weight: bold;
text-align: center;
float: left;
}
.title, .value {
float:left;
width: 230px;
height: 20px;
background: #fff;
padding: 5px 10px;
}
.title {
clear: left;
}
.title:nth-child(4n+1), .value:nth-child(4n+2) {
background: rgb(0, 117, 194);
color: #fff;
}
.value {
word-wrap: break-word;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
JavaScript
FusionCharts.ready(function () {
var cSatScoreChart = new FusionCharts({
type: 'angulargauge',
renderAt: 'chart-container',
width: '400',
height: '250',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": "Customer Satisfaction Score",
"subcaption": "Last week",
"lowerLimit": "0",
"upperLimit": "100",
"lowerLimitDisplay": "Bad",
"upperLimitDisplay": "Good",
"showValue": "1",
"valueBelowPivot": "1",
"theme": "fint",
"clickURL": "#!/demoURL"
},
"colorRange": {
"color": [
{
"minValue": "0",
"maxValue": "50",
"code": "#e44a00"
},
{
"minValue": "50",
"maxValue": "75",
"code": "#f8bd19"
},
{
"minValue": "75",
"maxValue": "100",
"code": "#6baa01"
}
]
},
"dials": {
"dial": [{
"value": "67"
}]
}
},
"events": {
/**
* @description
* This event is triggered every time a chart is clicked.
*
* @param {Object} eventObj: An object containing all the details related to this event like eventId, sender, etc.
* @param {Object} dataObj: An object containing all the details related to chart data such as the chart ID, chart width and height, etc.
*/
"chartClick": function (eventObj, dataObj) {
// console.log(eventObj);
...