Using built-in interactions
Here is a list of the built-in interactions:
Crosshair: This interaction helps the user to get precise
x
andy
values for a specific point on a chart. Because of this, it is applicable to cartesian charts only. Thex
andy
values are obtained by single-touch dragging on the chart.The interaction also offers additional configs:
axes
: This can be used to provide label text and label rectangle configs on a per axis basis usingleft
,right
,top
, andbottom
configs or a single config applying to all the axes. If theaxes
config is not specified, the axis label value is shown as the text and the rectangle will be filled with white color.lines
: The interaction draws horizontal and vertical lines through the point on the chart. Line sprite attributes can be passed using horizontal or vertical configs.For example, we configure the following
crosshair
interaction on a CandleStick chart:interactions: [{ type: 'crosshair', axes: { left: { ...