Group

Type class

Creates an SVG <g> element.

SVG groups are used for elements that need more elements just one.

Click here About <g> element

Sources

Group can be used (imported) via one of the following packages.

/**
 * --------------------------------------------------------
 * Import from: "core.ts"
 * Use like: am4core.Group
 * --------------------------------------------------------
 */
import * as am4core from "@amcharts/amcharts4/core";

/**
 * --------------------------------------------------------
 * Include via: <script src="core.js"></script>
 * Access items like: am4.Group
 * --------------------------------------------------------
 */

Inheritance

Group extends AMElement.

Group is not extended by any other symbol.

Properties

content
#

Type string

Content of the group element.

Can be used to add a lot of proprietary SVG markup into group.

node
#

Type SVGSVGElement

Inherited from AMElement

An SVG node of the element.

rotation
#

Type number

Inherited from AMElement

Element's rotation in degrees.

scale
#

Type number

Inherited from AMElement

Element's scale where 1 is original size.

Setting to 0.5 will reduce element's size by 50%, 2 will make element twice as large, etc.

textContent
#

Type string

Inherited from AMElement

Text contents of the SVG element.

x
#

Type number

Inherited from AMElement

Element's X position in pixels.

y
#

Type number

Inherited from AMElement

Element's Y position in pixels.

There are 6 inherited items currently hidden from this list.

Methods

add(

element: AMElement

)

#

Returns void

Adds an element to group.

This will manipulate DOM. element will be physically moved into group.

addClass(

name: string

)

#

Returns void

Inherited from AMElement

Adds a class to element.

addStyle(

attributes: Object

)

#

Returns AMElement

Inherited from AMElement

Adds style attributes to element's node.

addToBack(

element: AMElement

)

#

Returns void

Adds an element to group.

This will manipulate DOM. element will be physically moved into group.

attr(

attributes: ISVGAttribute

)

#

Returns AMElement

Inherited from AMElement

Sets a set of attributes on a element.

attrNS(

ns: string,
attribute: string,
value: string

)

#

Returns AMElement

Inherited from AMElement

Sets a single attribute of the element's node using namesspace.

constructor(

elementName: string

)

#

Returns Group

Constructor.

dispose()

#

Returns void

Inherited from AMElement

Disposes element.

getAttr(

attribute: string

)

#

Returns string | null

Inherited from AMElement

Returns a value of a node attribute.

getAttrNS(

ns: string,
attribute: string

)

#

Returns string

Inherited from AMElement

Returns a namespaced attribute value from node.

getBBox()

#

Returns IRectangle

Inherited from AMElement

Returns bounding box of the element.

ATTENTION: Bounding box calculations are extremely costly so should be used sparingly and cached whenever possible.

getStyle(

attribute: string

)

#

Returns string

Inherited from AMElement

Returns style attribute value.

hasChild(

element: AMElement

)

#

Returns boolean

Checks if this group already has the child element added

isDisposed()

#

Returns boolean

Inherited from AMElement

Was this element already been disposed?

moveTo(

point: IPoint

)

#

Returns void

Inherited from AMElement

Moves the element to new coordinates.

removeAttr(

attribute: string

)

#

Returns void

Inherited from AMElement

Removes an attribute from element.

removeChildNodes()

#

Returns void

Inherited from AMElement

Removes all element's child nodes, basically leaving it empty.

removeChildren()

#

Returns void

Removes all children from the group.

removeClass(

name: string

)

#

Returns void

Inherited from AMElement

Removes a class from element.

removeElement(

element: AMElement

)

#

Returns void

Removes the element from group.

Please note that this will not dispose the element itself, it will just remove it from the group.

removeNode()

#

Returns void

Inherited from AMElement

Removes element's node from DOM.

removeStyle(

attribute: string

)

#

Returns void

Inherited from AMElement

Removes style attribute from node.

setClass(

name: string

)

#

Returns void

Inherited from AMElement

Sets a class name on element.

There are 17 inherited items currently hidden from this list.

Events

Group does not have any events.

Adapters

Group does not have any adapters.