Chart Events
jqxChart raises events when the user moves in or out of a series element displayed, clicks on an element, changes the selection of a range selector and more.
For complete list of events please check the API reference. To handle chart events you need to implement event handlers.
An event handler function must accept one argument which contains information about the event. When jqxChart raises an event, it will include all related event information in an arguments object and pass with the event as a property.
Each event information contains the follow properties:
- type - name of the event.
- args - event arguments
- seriesGroup - the series group where the event originated. Applicable to mouse, touch and toggle events.
- serie - serie where the event originated. Applicable to mouse, touch and toggle events.
- elementIndex - zero based index of the element in the data source. Applicable to mouse, touch and toggle events.
- elementValue - value of the element. Applicable to mouse, touch and toggle events.
- instance - instance of the chart. Applicable to range selector and refresh events.
- state - toggle state (true/false) of the serie or item. Applicable to toggle events.
- state - toggle state (true/false) of the serie or item. Applicable to toggle events.
- minValue - range selector minimum value. Applicable to range selector events.
- maxValue - range selector maximum value. Applicable to range selector events.
The following example demonstrates the mouseover, mouseout and click events:
Move the mouse cursor over the columns in the chart below and click on them
|
|
Here is the example's source code: