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()
Try it:
Edge interactivity setter
Detailed description
When edge interactivity is enabled each edge has own path object.
Disable edge interactivity for decrease chart rendering time. On charts with large numbers of edges, edge interactivity has disabled state, but you can turn it on.
Disable edge interactivity for decrease chart rendering time. On charts with large numbers of edges, edge interactivity has disabled state, but you can turn it on.
Params:
Name | Type | Default | Description |
---|---|---|---|
value | boolean | true | Look detailed description |
Returns:
anychart.core.graph.elements.Interactivity - Self instance for method chaining. See listing
chart.interactivity().edges(false) //Disable edge interactivity
Try it:
enabled
Chart interactivity getter.
var chartInteractivityEnabled = chart.interactivity().enabled()
Returns:
boolean - Interactivity enabled StateTry it:
Chart interactivity setter.
Params:
Name | Type | Default | Description |
---|---|---|---|
value | boolean | 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
Try it:
hoverGap
Params:
Name | Type | Default | Description |
---|---|---|---|
value | number | 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);
Try it:
magnetize
magnetize getter
Returns:
boolean - Will node stick to other nodes or not. See listing
var magnetize = chart.interactivity().magnetize();
magnetize setter
Params:
Name | Type | Default | Description |
---|---|---|---|
value | boolean | 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()
Try it:
Nodes interactivity setter
Params:
Name | Type | Default | Description |
---|---|---|---|
value | boolean | 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
Try it:
scrollOnMouseWheel
scrollOnMouseWheel getter
Detailed description
When you pass true into this method, you turn it on, but you disable scrollOnMouseWheel.
Returns:
boolean - Enabled or disabled scroll on mousewheel See listing
chart.interactivity().scrollOnMouseWheel(false); //disable scroll
Try it:
scrollOnMouseWheel setter
Detailed description
When you pass true into this method, you turn it on, but you disable zoomOnMouseWheel.
Params:
Name | Type | Default | Description |
---|---|---|---|
value | boolean | false | Enabled mouse scroll. |
Returns:
anychart.core.graph.elements.Interactivity - Self instance for method chaining. See listing
var scrollEnabled = chart.interactivity().scrollOnMouseWheel();
Try it:
zoomOnMouseWheel
zoomOnMouseWheel getter
Returns:
boolean - Enabled or disabled zoom on mousewheel See listing
var scrollEnabled = chart.interactivity().scrollOnMouseWheel();
Try it:
zoomOnMouseWheel setter
Detailed description
When you pass true into this method, you turn it on, but you disable scrollOnMouseWheel.
Params:
Name | Type | Default | Description |
---|---|---|---|
value | boolean | true | Enabled mouse wheel zoom. |
Returns:
anychart.core.graph.elements.Interactivity - Self instance for method chaining. See listing
chart.interactivity().zoomOnMouseWheel(false); //disable scroll
Try it: