AnyChart
API Reference
Still have questions?
Contact support
Top

class anychart.core.graph.elements.Interactivity Improve this Doc

Graph chart interactivity class.

Methods Overview

Miscellaneous
edges()Enable or disable edge interactivity.
enabled()Enable or disable chart interactivity.
hoverGap()Change distance that you can interact with edge.
magnetize()Should node stick to closest sibling coordinate when you stop dragging node.
nodes()Allow node drag interactivity.
scrollOnMouseWheel()Do scroll on mousewheel event or not.
zoomOnMouseWheel()Do zoom on mousewheel event or not.

Methods Description

edges

Edge interactivity getter

Returns:

boolean - Interactivity enabled state for edges.
See listing
var edgesInteractivityEnabled = chart.interactivity().edges()
Edge interactivity setter

Params:

NameTypeDefaultDescription
valueboolean
true
Look detailed description

Returns:

anychart.core.graph.elements.Interactivity - Self instance for method chaining.
See listing
chart.interactivity().edges(false) //Disable edge interactivity

enabled

Chart interactivity getter. var chartInteractivityEnabled = chart.interactivity().enabled()

Returns:

boolean - Interactivity enabled State
Chart interactivity setter.

Params:

NameTypeDefaultDescription
valueboolean
true
Enabled or disable chart interactivity.

Returns:

anychart.core.graph.elements.Interactivity - Self instance for method chaining.
See listing
chart.interactivity().enabled(true) //now you can drag chart

hoverGap

Returns:

number - Hover distance
See listing
var hoverGap = chart.interactivity().hoverGap();

Params:

NameTypeDefaultDescription
valuenumber
7
Distance between edge and mouse cursor.

Returns:

anychart.core.graph.elements.Interactivity - Self instance for method chaining.
See listing
var hoverGap = 15;
chart.interactivity().hoverGap(hoverGap);

magnetize

magnetize getter

Returns:

boolean - Will node stick to other nodes or not.
See listing
var magnetize = chart.interactivity().magnetize();
magnetize setter

Params:

NameTypeDefaultDescription
valueboolean
false
Can node stick to closest sibling coordinate.

Returns:

anychart.core.graph.elements.Interactivity - Self instance for method chaining.
See listing
chart.interactivity().magnetize(true);

nodes

Nodes interactivity getter

Returns:

boolean - Interactivity enabled state for nodes.
See listing
var nodesInteractivityEnabled = chart.interactivity().nodes()
Nodes interactivity setter

Params:

NameTypeDefaultDescription
valueboolean
true
Allow node drag interactivity.

Returns:

anychart.core.graph.elements.Interactivity - Self instance for method chaining.
See listing
chart.interactivity().nodes(false) //disable node interactivity

scrollOnMouseWheel

scrollOnMouseWheel getter

Returns:

boolean - Enabled or disabled scroll on mousewheel
See listing
chart.interactivity().scrollOnMouseWheel(false); //disable scroll
scrollOnMouseWheel setter

Params:

NameTypeDefaultDescription
valueboolean
false
Enabled mouse scroll.

Returns:

anychart.core.graph.elements.Interactivity - Self instance for method chaining.
See listing
var scrollEnabled = chart.interactivity().scrollOnMouseWheel();

zoomOnMouseWheel

zoomOnMouseWheel getter

Returns:

boolean - Enabled or disabled zoom on mousewheel
See listing
var scrollEnabled = chart.interactivity().scrollOnMouseWheel();
zoomOnMouseWheel setter

Params:

NameTypeDefaultDescription
valueboolean
true
Enabled mouse wheel zoom.

Returns:

anychart.core.graph.elements.Interactivity - Self instance for method chaining.
See listing
chart.interactivity().zoomOnMouseWheel(false); //disable scroll