Events can be used for applications like monitoring the state of a system or a business. For example, you can listen to an event to observe the temperature of a deep freezer and display an alert message if the temperature falls below the minimum value.
Take a look at the pie chart shown below:
Roll the mouse pointer over any one pie slice and see how the text (the slice label and the no. of visitors) rendered below the chart changes.
For example, if you roll the mouse pointer over the Senior slice, the following text is displayed is below the chart:
Age group: Senior
No. of visitors: 491000
This happens because the
dataPlotRollOver and the
dataPlotRollOut events are configured for this pie chart. Every time, the mouse pointer is rolled over any pie slice, the
dataPlotRollOver event is triggered. In response to this event, the text shown below the chart is updated to reflect the details for that pie slice.
Every time, the mouse pointer is rolled out of a pie slice, the
dataPlotRollOut event is triggered. In response to this event, the text below the chart returns to its original value.