.off( evtName )

Remove all event handlers for the specified event. Should be called when a chart is disposed.

chart.off( event )

Arguments

Name Type Required Description
event string yes Name of the interaction event to bind the function. (mouseover)

Available Events

Name Description
'mouseover' fires when the mouse moves over elements on the chart
'mouseout' fires when the mouse leaves an elements on the chart
'click' fires when on clicking an element on the chart

Example Code

<div class="row">
  <div class="col-lg-12" id="chart"></div>
</div>

<script>

   //define a handler for chart events 
  function showItem(event,data){
    //dump data to console...
    console.dir(data);
  }

  //setup a chart using a json file that is the complete definition
  var chart = new Cedar({
    "definition":"../../../cedar/data/definitions/scatter-events.json"
  });

  //render the chart
  chart.show({
    elementId: "#chart"
  });

  //attach handler (can also be done before .show())
  chart.on('click', showItem);

  //remove handler
  chart.off('click');

</script>

Edit this page on GitHub