In this section, we will discuss events in the context of FusionCharts. Events provide a way to track what is happening in and around charts created using FusionCharts. You can tap into events during the different stages in the life cycle of a chart e.g. while data load is in progress, chart rendering has been completed, user interacts with chart elements and so on.
The most important and useful way to tap in to events is by listening to them. This method allows us to assign a function which will execute when the event is fired (takes place).
Other more advanced use cases can tap into FusionCharts’ ability to remove and cancel events.
The following example demonstrates a simple case of tapping into the
renderComplete event of a chart. This event is fired when the chart has been rendered successfully. We change the color of the chart columns by changing the
paletteColors chart attribute inside the
renderComplete event handler. Since, the animation occurs after this event, we add a timeout of 1000 milliseconds.