Writing event handlers
You can write scripts in JavaScript that specify the task to perform when a particular event occurs. This type of script is called an event handler. Like BIRT charts, HTML5 charts support two types of event handlers:
*
Event handlers that respond to user interactions, such as a mouse click on a legend or a mouse over a series, when viewing the report. For example, you can create an event handler to link to another report when a user clicks a bar in a bar chart.
*
Event handlers that respond to chart events, which occur when BIRT renders the chart. Use this type of event handler to conditionally change or add chart elements as the chart is being generated. For example, you can write an event handler to calculate an average value and display this value as a marker line.
For both types of event handlers, you use the script editor in the chart builder, as shown in Figure 15-6. To launch the script editor, choose the Script tab.
Figure 15-6  
To create an event handler that responds to a user interaction, choose Interactivity. To create an event handler that responds to a chart event, choose Client Script, as shown in Figure 15-6.
Scripts that you write using Client Script apply to HTML5 charts only. If you later change a chart’s output format from HTML5 to SVG, BIRT ignores these client-side scripts when generating the chart.

Additional Links:

Copyright Actuate Corporation 2012