class anychart.core.graph.elements.Edge Improve this Doc
Graph chart edge class.
Methods Overview
| Coloring | |
| stroke() | Stroke settings. |
| State settings | |
| hovered() | Hovered state settings. |
| normal() | Normal state settings. |
| selected() | Selected state settings. |
| Miscellaneous | |
| arrows() | Arrows controller getter. |
| labels() | Labels getter |
| tooltip() | Tooltip getter |
Methods Description
arrows
Arrows controller getter.
Returns:
anychart.core.graph.elements.edges.arrows.Controller - Arrows controller instance. See listing
var arrowsController = chart.edges().arrows(); arrowsController.enabled(true); // Enable arrows drawing.
Arrows config setter
Params:
| Name | Type | Description |
|---|---|---|
| config | anychart.core.graph.elements.edges.arrows.Controller.Config | Config with settings for the arrows controller. |
Returns:
anychart.core.graph.elements.Edge - Self instance for method chaining. See listing
chart.edges().arrows({
enabled: true,
size: 15,
position: '50%'
}); // Enable arrows that has size 15 pixels and located at the middle of the edge.Try it:
hovered
Getter for hovered state settings.
Returns:
anychart.core.StateSettings - Hovered state settings See listing
var edgesHovered = chart.edges().hovered();
var labels = edgesHovered().labels();
labels.enabled(true); //Enabled labels for hovered edges
labels.fontColor('#555F5E'); //and set font colorTry it:
Setter for hovered state settings.
Params:
| Name | Type | Description |
|---|---|---|
| settings | Object | State settings to set. |
Returns:
anychart.core.graph.elements.Edge - Self instance for method chaining.Try it:
labels
Labels getter
Detailed description
Note: Labels for edges has disabled state by default.
Returns:
anychart.core.ui.LabelsFactory - LabelsSettings instance. See listing
var labels = chart.edges().labels(); labels.enabled(true); labels.fontSize(8);
Try it:
Labels setter
Params:
| Name | Type | Description |
|---|---|---|
| labelsConfig | object | Config with settings for labels. |
Returns:
anychart.core.graph.elements.Edge - Self instance for method chaining. See listing
var labelsConfig = {fontFamily: 'Arial', fontSize:14, fontColor: '#000'};
chart.edges().labels(labelsConfig};Try it:
normal
Getter for normal state settings.
Detailed description
Call chart.edges().normal().fill() same as chart.edges().fill()
Returns:
anychart.core.StateSettings - Normal state settings. See listing
var edgesNormal = chart.edges().normal();
edgesNormal.stroke('3 blue') //Set stroke for edges that has normal state.Try it:
Setter for normal state settings.
Params:
| Name | Type | Description |
|---|---|---|
| settings | Object | State settings to set. |
Returns:
anychart.core.graph.elements.Edge - Self instance for method chaining.Try it:
selected
Getter for selected state settings.
Returns:
anychart.core.StateSettings - Selected state settings See listing
var edgesSelected = chart.edges().selected();
edgeSelected.stroke('2 red 0.5'); //Set stroke with opacity for selected edges.Try it:
Setter for selected state settings.
Params:
| Name | Type | Description |
|---|---|---|
| settings | Object | State settings to set. |
Returns:
anychart.core.graph.elements.Edge - Self instance for method chaining.Try it:
stroke
Getter for the graph elements slices stroke.
Returns:
anychart.graphics.vector.Stroke | function():anychart.graphics.vector.Stroke|anychart.graphics.vector.ColoredFill - Stroke for the normal state. See listing
var stroke = chart.edges().stroke();
Try it:
Setter for the graph elements slices stroke using function.
Learn more about stroke settings.
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| fillFunction | function():anychart.graphics.vector.Stroke|anychart.graphics.vector.ColoredFill | // return stroke from the default palette.
function() {
return anychart.color.darken(this.sourceColor);
}; | Stroke-function, which should look like:function() {
// this: {
// index : number - the index of the current point
// sourceColor : anychart.graphics.vector.Stroke - stroke of the current point
// }
return myStroke; //anychart.graphics.vector.Stroke
}; |
Returns:
anychart.core.graph.elements.Edge - Self instance for method chaining.Try it:
Setter for the graph elements slices stroke.
Learn more about stroke settings.
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| color | anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | null | 'none' | Stroke settings. |
| thickness | number | Line thickness. | |
| dashpattern | string | Controls the pattern of dashes and gaps used to stroke paths. | |
| lineJoin | string | anychart.graphics.vector.StrokeLineJoin | Line join style. | |
| lineCap | string | anychart.graphics.vector.StrokeLineCap | Line cap style. |
Returns:
anychart.core.graph.elements.Edge - Self instance for method chaining.Try it:
Setter for the graph elements slices stroke using an object.
Params:
| Name | Type | Description |
|---|---|---|
| settings | Object | Object with stroke settings from anychart.graphics.vector.Stroke |
Returns:
anychart.core.graph.elements.Edge - Self instance for method chaining.Try it:
tooltip
Tooltip getter
Returns:
anychart.core.ui.Tooltip - Tooltip instance. See listing
var edgesTooltip = chart.edges().tooltip(); edgesTooltip.enabled(false); //Disable tooltip for edges.
Try it:
Tooltip setter
Params:
| Name | Type | Description |
|---|---|---|
| tooltipConfig | object | boolean | null | Config with settings for tooltip. |
Returns:
anychart.core.graph.elements.Edge - Self instance for method chaining. See listing
var config = {enabled: true, format: 'Edge', background: {fill: '#EF9A9A', stroke: '#1B5E20'}};
chart.edges().tooltip(config); //setup tooltip via configTry it:
