AnyChart
API Reference
Still have questions?
Contact support
Top

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

Graph chart group class.

Methods Overview

Appearance
fill()Fill for nodes of current group.
shape()Shape for nodes of current group.
stroke()Stroke for nodes of current group.
Point Elements
labels()Labels for nodes of current group.
Size
height()Height for nodes of current group.
width()Width for nodes of current group.
State settings
hovered()Hovered state settings.
normal()Normal state settings.
selected()Selected state settings.

Methods Description

fill

Getter for fill.
Setter for fill.

Params:

NameTypeDescription
coloranychart.graphics.vector.Fill | stringFill object or string color

Returns:

anychart.core.graph.elements.Group - Self instance for method chaining.
Setter for function fill.

Params:

NameTypeDescription
FunctionfunctionFunction for color resolve.

Returns:

anychart.core.graph.elements.Group - Self instance for method chaining.

height

Getter for height.

Returns:

number - Height of the nodes of the group.
Setter for height

Params:

NameTypeDefaultDescription
valuenumber
12
Height for the nodes of the group.

Returns:

anychart.core.graph.elements.Group - Group instance.

hovered

Getter for hovered state settings.

Returns:

anychart.core.StateSettings - Hovered state settings
See listing
var group1 = chart.group('group1');
var groupHoveredState = group1.hovered()
groupNormalState.stroke('blue', 2, '3 1') //Set stroke for all nodes of this group that has hovered state.
Setter for hovered state settings.

Params:

NameTypeDescription
settingsObjectState settings to set.

Returns:

anychart.core.graph.elements.Group - Self instance for method chaining.

labels

Getter for labels.

Returns:

anychart.core.ui.LabelsFactory - LabelsSettings instance.
Setter for labels.

Params:

NameTypeDescription
configobjectSettings object for labels

Returns:

anychart.core.graph.elements.Group - Group instance.

normal

Getter for normal state settings.

Returns:

anychart.core.StateSettings - Normal state settings.
See listing
var group1 = chart.group('group1');
var groupNormalState = group1.normal()
groupNormalState.shape('square') //Set shape for all nodes of this group that has normal state.
Setter for normal state settings.

Params:

NameTypeDescription
settingsObjectState settings to set.

Returns:

anychart.core.graph.elements.Group - Self instance for method chaining.

selected

Getter for selected state settings.

Returns:

anychart.core.StateSettings - Selected state settings
See listing
var group1 = chart.group('group1');
var groupHoveredState = group1.selected();
var labels = groupNormalState.labels();
labels.enabled(true);
labels.format('Selected node {%id}');
Setter for selected state settings.

Params:

NameTypeDescription
settingsObjectState settings to set.

Returns:

anychart.core.graph.elements.Group - Self instance for method chaining.

shape

Getter for shape.

Returns:

string - The elements shape.
Setter for shape.

Params:

NameTypeDefaultDescription
valueanychart.enums.MarkerType | string
'circle'
Value to set.

Returns:

anychart.core.graph.elements.Group - Group instance.

stroke

Getter for stroke.
Setter for stroke.

Params:

NameTypeDescription
functionfunctionFunction for color resolve.

Returns:

anychart.core.graph.elements.Group - Self instance for method chaining.
Setter for function stroke.

Params:

NameTypeDescription
coloranychart.graphics.vector.FillString or object

Returns:

anychart.core.graph.elements.Group - Self instance for method chaining.
Setter for the graph elements slices stroke. Learn more about stroke settings.

Params:

NameTypeDefaultDescription
coloranychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | null
'none'
Stroke settings.
thicknessnumber
Line thickness.
dashpatternstring
Controls the pattern of dashes and gaps used to stroke paths.
lineJoinstring | anychart.graphics.vector.StrokeLineJoin
Line join style.
lineCapstring | anychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.core.graph.elements.Group - Self instance for method chaining.

width

Getter for width.

Returns:

number - width of nodes of current group.
Setter for width.

Params:

NameTypeDefaultDescription
valuenumber
12
Width of the group.

Returns:

anychart.core.graph.elements.Group - Group instance.