FusionCharts - Dynamic tooltips using HTML and macros in Marimekko Chart
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.charts.js"></script>
<script src="http://static.fusioncharts.com/code/latest/themes/fusioncharts.theme.fint.js"></script>
<!--
Dynamic tool-tips in Marimekko chart bulit using macros.
Attribute:
# plotTooltext - Set the string for tooltip with macros.
Macros used:
$xAxisPercentValue
$percentValue
$seriesName
$label
$dataValue
-->
<div id="chart-container">FusionCharts will render here</div>
JavaScript
FusionCharts.ready(function () {
var salesByBrandChart = new FusionCharts({
type: 'marimekko',
renderAt: 'chart-container',
width: '450',
height: '300',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": "Top 3 Electronic Brands in Top 3 Revenue Earning States",
"subcaption": "Last month",
"aligncaptiontocanvas": "0",
"yaxisname": "Statewise Sales (in %)",
"xaxisname": "Brand",
"numberprefix": "$",
"showPlotBorder" : "1",
"plotBorderThickness":"0.25",
"showxaxispercentvalues": "1",
"showsum": "1",
//Custom tool-text string built using a combination of HTML and chart macro variables
"theme": "fint"
},
"categories": [
{
"category": [
{
"label": "Bose"
},
{
"label": "Dell"
},
{
"label": "Apple"
}
]
}
],
"dataset": [
{
"seriesname": "California",
"plottooltext" : "<div class='cc'>cc</div>",
"data": [
{
"value": "335000"
},
{
"value": "225100"
},
{
"value": "164200"
}
]
},
{
"seriesname": "Washington",
"plottooltext" : "<div class='kk'>kk</div>",
"data": [
{
"value": "215000"
},
{
"value": "198000"
},
{
"value": "120000"
}
]
},
{
"seriesname": "Nevada",
"plottooltext" : "<div class='qq'>qq</div>",
...