FusionCharts API-Methods: showChartMessage
Created using FusionCharts Suite XT - www.fusioncharts.com
by FusionCharts
HTML
<script src="http://static.fusioncharts.com/code/latest/themes/fusioncharts.theme.fint.js"></script>
<script src="https://static.fusioncharts.com/code/latest/fusioncharts.js"></script>
<script src="https://static.fusioncharts.com/code/latest/themes/fusioncharts.theme.fint.js"></script>
<!-- This sample shows the usage of the showChartMessage() method. -->
<div id="indicatorDiv">Method Name: <strong>showChartMessage()</strong>
<p>Shows a text message on a chart.</p>
<p>In the text box given below, enter your message.</p>
<p>From the drop-down, select the mode to render the message.</p>
<p>Click <strong>Show Message</strong> to render the message.</p>
<div class="">
<input type="text" id="chart_message" placeholder="Enter your message here." />
<select id="mode">
<option value="overlaycan">Show message as modal</option>
<option value="overlay">Show message as non-closable modal</option>
<option value="onchart">Show message over the chart</option>
</select>
<button id="show_message">Show Message</button>
</div>
</div>
<div id="chart-container">FusionCharts will render here</div>
CSS
body {
padding: 5px;
margin: 0 auto;
}
strong{
font-weight: bold;
}
.text-center {
text-align: center;
}
p {
margin: 10px auto;
}
.mb-20 {
margin-bottom: 20px;
}
#indicatorDiv {
width: 600px;
font-family:'Arial', 'Helvetica';
font-size: 13px;
}
#chart_message {
font-family:'Arial', 'Helvetica';
font-size: 13px;
margin: 10px 0;
padding: 10px;
}
#mode {
font-size: 13px;
padding: 10px;
height: 40px;
}
#show_message {
margin: 10px 0;
font-size: 13px;
padding: 10px;
}
JavaScript
FusionCharts.ready(function () {
var revenueChart = new FusionCharts({
type: 'mscolumn2d',
renderAt: 'chart-container',
width: '500',
height: '300',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": "Comparison of Quarterly Revenue",
"xAxisname": "Quarter",
"yAxisName": "Revenues (In USD)",
"numberPrefix": "$",
"plotFillAlpha": "80",
"theme": "fint"
},
"categories": [{
"category": [{
"label": "Q1"
}, {
"label": "Q2"
}, {
"label": "Q3"
}, {
"label": "Q4"
}]
}],
"dataset": [{
"seriesname": "Previous Year",
"data": [{
"value": "10000"
}, {
"value": "11500"
}, {
"value": "12500"
}, {
"value": "15000"
}]
}, {
"seriesname": "Current Year",
"data": [{
"value": "25400"
}, {
"value": "29800"
}, {
"value": "21800"
}, {
"value": "26800"
}]
}],
"trendlines": [{
"line": [{
"startvalue": "12250",
"color": "#0075c2",
"displayvalue": "Previous{br}Average",
"valueOnRight": "1",
"thickness": "1",
"showBelow": "1",
"tooltext": "Previous year quarterly target : $13.5K"
}, {
...