This third tutorial details charts events and interactions.
This tutorial will help you understand:
- What are the different chart events
- How-to listen to events
- How-to push events
What do you need?
- 15 minutes
- A working Kotlin JS environment (see part 1)
- Intellij Community or Ultimate (tested with IntelliJ 2020.3.*)
The chart events
There are 4 chart events you can bind on, here is a cheat sheet presenting all of them:
Highlight event
- This event is a Data Event, it takes and returns
DOMAIN
objects
- This event is enabled by default, disable it with
config.events.highlightMode
- Listen:
chart.onHighlight(listener: (event: HighlightEvent<DOMAIN>) -> Unit)
- Push:
chart.highlight(domains: Collection<DOMAIN>)
or chart.highlight(data: Collection<Datum<DOMAIN>>)
Select event
- This event is a Data Event, it takes and returns
DOMAIN
objects
- This event is disabled by default, disable it with
config.events.selectionMode
- Listen:
chart.onSelect(listener: (event: SelectEvent<DOMAIN>) -> Unit)