Building HTML5 charts : Writing event handlers : Writing event handlers that respond to chart events
 
Writing event handlers that respond to chart events
Unlike event handlers that respond to user interactions with the chart, the event handlers that you write for chart events require programming in JavaScript. You also have to learn the Highcharts API to know what chart options you can manipulate and how.
In the script editor, you select an event function, such as beforeRendering( ) or beforeDrawAxis( ), then you write code that performs a specific task or tasks when the chart event occurs. The event handlers that you write for HTML5 chart events differ from the event handlers for BIRT charts in several important aspects, as described in Table 12‑2.
Table 12‑2 Comparison of event handlers in HTML5 charts and BIRT charts
Event handlers in HTML5 charts
Event handlers in BIRT charts
Support only JavaScript
Support JavaScript and Java
Use client-side scripting and limited server-side scripting
Use server-side scripting only
Use the Highcharts API
Use BIRT’s charting API
Write client-side scripts using the script editor accessible from the Script tab in the chart builder. Write server-side scripts using the script editor accessible from the Script tab in the report editor. Only the following server-side event functions are supported for HTML5 charts: beforeDataSetFilled( ), afterDataSetFilled( ), and beforeGeneration( )
This section provides information about writing client-side event handlers for HTML5 chart events. For information about writing server-side event handlers, see Integrating and Extending BIRT.
For documentation about the Highcharts API, go to the following location:
http://www.highcharts.com/ref/