Writing a JavaScript chart event handler
The process of writing a JavaScript chart event handler differs from the process of writing a JavaScript event handler for other report items. In BIRT Report Designer, Script displays only the onRender event in the list of JavaScript events for a chart report item. The list next to the JavaScript events list contains a list of the all the chart events, as shown in Figure 39‑1.
Figure 22-12 Chart script tabFigure 22-12 Chart script tab
Figure 39‑1 Script event functions for a chart in BIRT Report Designer
When you select one of the events from the list, BIRT adds a stub for that event in the onRender script window, as shown in Figure 39‑2.
Figure 22-13 Chart script tab with added stubFigure 22-13 Chart script tab with added stub
Figure 39‑2 Chart script stub
To write handler code for an event, type the handler code between the parentheses.
To code more chart event handlers, select the event from the list. Stub code for the event appears at the end of the script editor page. This page contains the JavaScript code for every event handler for the chart.