FusionCharts - Dynamic tool-tips using Macros in JavaScript Heatmap charts.

Created using FusionCharts Suite XT - www.fusioncharts.com

by Nabajeet Sonowal

HTML

<script src="http://static.fusioncharts.com/code/latest/fusioncharts.js"></script>
<script src="http://static.fusioncharts.com/code/latest/fusioncharts.powercharts.js"></script>
<script src="http://static.fusioncharts.com/code/latest/themes/fusioncharts.theme.fint.js"></script>
<!-- Dynamic tooltips using Macros in Heatmap charts.

    Attribute: 
        # plotTooltext - Set the string with macro.
    Macros: 
        $rowLabel 
        $tlLabel 
        $trLabel 
        $dataValue 
        $columnLabel
Note: 
    Similar Usage for the following Macros 
        $blLabel
        $brLabel

    Deviation from theme :
        # showplotborder - Set to 1, as plots need to show bordered heat area.
-->

<div id="chart-container">FusionCharts will render here</div>

JavaScript

FusionCharts.ready(function () {
    var salesHMChart = new FusionCharts({
        type: 'heatmap',
        renderAt: 'chart-container',
        width: '550',
        height: '270',
        dataFormat: 'json',
        dataSource:  {
            "chart": {
                "caption": "Top Smartphone Ratings",
                "subcaption": "By Features",
                "xAxisName":"Features",
                "yAxisName":"Model",
                "showplotborder": "1",
                "xAxisLabelsOnTop": "1",
                "plottooltext":"<font color='red'>Rating : </font> <b>$dataValue</b>",
                "theme" : "fint"
            },
            "rows": {
                "row": [
                    {
                        "id": "SGS5",
                        "label": "Samsung Galaxy S5"
                    },
                    {
                        "id": "HTC1M8",
                        "label": "HTC One (M8)"
                    },
                    {
                        "id": "IPHONES5",
                        "label": "Apple iPhone 5S"
                    },
                    {
                        "id": "LUMIA",
                        "label": "Nokia Lumia 1520"
                    }
                ]
            },
            "columns": {
                "column": [
                    {
                        "id": "processor",
                        "label": "Processor"
                    },
                    {
                        "id": "screen",
                        "label": "Screen Size"
                    },
                    {
                        "id": "price",
                        "label": "Price"
                    },
                    {
                        "id": "backup",
                        "label": "Battery Backup"
                    }
					,
                    {
                        "id": "cam",
                        "label": "Camera"
                    }
                ]
    ...