Class Interaction
- java.lang.Object
-
- org.pepstock.charba.client.configuration.Interaction
-
public class Interaction extends Object
Definitions about how elements appear in the tooltip, hovering the chart.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Interaction(ConfigurationOptions options)
Builds the object storing the root options element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InteractionAxis
getAxis()
Returns to 'x', 'y', or 'xy' to define which directions are used in calculating distances.IsChart
getChart()
Returns the chart instanceprotected ExtendedOptions
getConfiguration()
Returns the configuration element.InteractionMode
getMode()
Returns which elements appear in the tooltip.protected ConfigurationOptions
getOptions()
Returns the configuration options.boolean
isIntersect()
if true, the hover mode only applies when the mouse position intersects an item on the chart.void
setAxis(InteractionAxis axis)
Sets to 'x', 'y', or 'xy' to define which directions are used in calculating distances.
Defaults to 'x' for index mode and 'xy' in data set and nearest modes.void
setIntersect(boolean intersect)
if true, the hover mode only applies when the mouse position intersects an item on the chart.void
setMode(InteractionMode mode)
Sets which elements appear in the tooltip.
-
-
-
Constructor Detail
-
Interaction
protected Interaction(ConfigurationOptions options)
Builds the object storing the root options element.- Parameters:
options
- root options element.
-
-
Method Detail
-
setMode
public void setMode(InteractionMode mode)
Sets which elements appear in the tooltip.- Parameters:
mode
- which elements appear in the tooltip.
-
getMode
public InteractionMode getMode()
Returns which elements appear in the tooltip.- Returns:
- which elements appear in the tooltip.
-
setIntersect
public void setIntersect(boolean intersect)
if true, the hover mode only applies when the mouse position intersects an item on the chart.- Parameters:
intersect
- if true, the hover mode only applies when the mouse position intersects an item on the chart.
-
isIntersect
public boolean isIntersect()
if true, the hover mode only applies when the mouse position intersects an item on the chart.- Returns:
- if true, the hover mode only applies when the mouse position intersects an item on the chart.
-
setAxis
public void setAxis(InteractionAxis axis)
Sets to 'x', 'y', or 'xy' to define which directions are used in calculating distances.
Defaults to 'x' for index mode and 'xy' in data set and nearest modes.- Parameters:
axis
- define which directions are used in calculating distances.
-
getAxis
public InteractionAxis getAxis()
Returns to 'x', 'y', or 'xy' to define which directions are used in calculating distances.- Returns:
- define which directions are used in calculating distances.
-
getOptions
protected final ConfigurationOptions getOptions()
Returns the configuration options.- Returns:
- the configuration options.
-
getConfiguration
protected final ExtendedOptions getConfiguration()
Returns the configuration element.- Returns:
- the configuration element.
-
getChart
public final IsChart getChart()
Returns the chart instance- Returns:
- the chart
-
-