FusionCharts API-Methods: removeEventListener

Created using FusionCharts Suite XT - www.fusioncharts.com

by FusionCharts

HTML

<script src="https://static.fusioncharts.com/code/latest/fusioncharts.js"></script>
<!-- This sample shows usage of the removeEventListener() method -->
<div id="indicatorDiv">Method Name: <strong>removeEventListener()</strong>
    
    <p>Removes the event listener(s) bound to an event using the <strong>addEventListener()</strong> method.</p>
    <p>For the pie chart below, first click the <strong>Set Event Listener</strong> button to add a listener for the <strong>dataplotRollOver</strong> event. Then, click the <strong> Remove Event Listener</strong> button to remove the listener for the <strong> dataplotRollOver</strong> event.</p>
    <p>After the listener has been removed, the chart details are not shown when the mouse pointer is rolled over a pie slice.</p>



    
   <div class="text-center">
   	 <button id="set">Set Event Listener</button>
   	<button id="rem">Remove Event Listener</button>  	
   	
   	<div id="data1"></div>
   	
   	<div id="chart-container">FusionCharts will render here</div>
   </div>
</div>

CSS

#set {
    height: 25px;
    font-size: 13px;
}
#rem {
    height: 25px;
    font-size: 13px;
}
#data1 {
    font-family:'Arial', 'Helvetica';
    font-size: 16px;
     margin: 10px 0;
}

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: 500px;
    font-family:'Arial', 'Helvetica';
    font-size: 13px;
}

JavaScript

FusionCharts.ready(function () {
    var visitChart = new FusionCharts({
        type: 'pie2d',
        renderAt: 'chart-container',
        width: '400',
        height: '250',
        dataFormat: 'json',
        dataSource: {
            "chart": {
                "caption": "Split of Visitors by Age Group",
                    "subCaption": "Last year",
                    "paletteColors": "#0075c2,#1aaf5d,#f2c500,#f45b00,#8e0000",
                    "bgColor": "#ffffff",
                    "showBorder": "0",
                    "use3DLighting": "0",
                    "showShadow": "0",
                    "enableSmartLabels": "0",
                    "startingAngle": "0",
                    "showPercentValues": "1",
                    "showPercentInTooltip": "0",
                    "decimals": "1",
                    "captionFontSize": "13",
                    "subcaptionFontSize": "12",
                    "subcaptionFontBold": "0",
                    "toolTipColor": "#ffffff",
                    "toolTipBorderThickness": "0",
                    "toolTipBgColor": "#000000",
                    "toolTipBgAlpha": "80",
                    "toolTipBorderRadius": "2",
                    "toolTipPadding": "5",
                    "showHoverEffect": "1",
                    "showLegend": "1",
                    "legendBgColor": "#ffffff",
                    "legendBorderAlpha": '0',
                    "legendShadow": '0',
                    "legendItemFontSize": '10',
                    "legendItemFontColor": '#666666'
            },
                "data": [{
                "label": "Teenage",
                    "value": "1250400"
            }, {
                "label": "Adult",
                    "value": "1463300"
            }, {
                "label": "Mid-age",
                    "value": "1050700"
            }, {
                "label": "Senior",
                    "value": "491000"
            }]
        }
    });

   ...