Improvement of the selection/highlight event

Actually, a select/highlight event is triggered containing only the Datum object, so we can’t know which mark triggers the event (in the case of multiple marks on the same chart).

Similarly, if we want to push a selection on a specific Datum only for a specific Mark we can’t do this, the select() function will select all marks for the current Datum.

image

See CHRT-214.

In the events config, you can now change the highlightPattern and the selectionPattern to SelectionPattern.SingleMark in order to select only one line.

When you are in SingleMark mode for selection :

  • if you bind to onSelect, you’ll get the 0-index based position of the selected mark for each selected Datum, just use the SelectionEvent.IndexedData for this

  • if you want to select only certain Datums for certain marks, just use the selectFor(domainsPerMark: Map<Int,Collection<DOMAIN>>) function in which you specify the DOMAIN objects that are selected for each 0-index based mark