call script on clickURL

501215

by Nabajeet Sonowal

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>
<!-- Using annotations to add a callout to a column. Positioning is done using annotation macros e.g., $dataset.0.set.3.x or $dataset.0.set.3.y. -->
<div id="chart-container">FusionCharts will render here</div>
<script>
    function lightboxgraph(dashboardid, type) {
        alert("testing clickurl");
    }
</script>

JavaScript

FusionCharts.ready(function () {
    var revenueChart = new FusionCharts({
        type: 'column2d',
        renderAt: 'chart-container',
        id: "myChart",
        width: '500',
        height: '350',
        dataFormat: 'json',
        dataSource: {
            "chart": {
                "caption": "Comparison of Quarterly Revenue",
                    "subCaption": "Last Year",
                    "showBorder": "0",
                    "xAxisName": "Quarter",
                    "yAxisName": "Amount (In USD)",
                    "numberPrefix": "$",
                    "yAxisMaxValue": "50000",
                    "showValues": "0",
                    "showTooltip": "0",
                    "theme": "fint",
                    "clickURL": "javascript:lightboxgraph('1','graph');"
            },
                "data": [{
                "label": "Q1",
                    "value": "25400",
                    "color": "#ffaaaa"
            }, {
                "label": "Q2",
                    "value": "29800"
            }, {
                "label": "Q3",
                    "value": "21800"
            }, {
                "label": "Q4",
                    "value": "26800"
            }],
                "annotations": {
                "drawImmediately": "1",
                    "showbelow": "0",
                    "groups": [{
                    "id": "Callout",
                        "items": [{
                        "id": "CalloutLabel1",
                            "type": "Text",
                            "fontSize": "12",
                            "bold": "1",
                            "fillcolor": "#000000",
                            "text": "$30K",
                            "x": "$dataset.0.set.0.x",
                            "y": "$dataset.0.set.0.starty + 20"
                    }, {
                        "id": "CalloutLabel2",
                            "type": "Text",
                            "fontSize": "12",
     ...