The React Chart supports click and hover events on its plot and allows you to select series and points.
Import the plugins listed above to create an interactive chart.
In uncontrolled mode, add the
HoverState plugin to the chart to enable the hovered state for series and points. You can also specify a series or point that is initialy hovered in the
In controlled mode, specify a hovered series or point in the
hover property and handle the
onHoverChange event to control the hover state externally.
selection property to specify selected series and points. Handle the
onClick event to change the selection state when a series or point is clicked.
The following demos show how to create a chart using the single and multiple selection mode.
Cmdfor MacOS) + mouse click