Group
Type class
Creates an SVG <g> element.
SVG groups are used for elements that need more elements just one.
More info: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/g 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: am4core.Group */Inheritance
Group extends AMElement.
Group is not extended by any other symbol.
Properties
contentType
stringContent of the group element.
Can be used to add a lot of proprietary SVG markup into group.
6 inherited items
nodeType
SVGSVGElementInherited fromAMElementAn SVG node of the element.
rotationType
numberInherited fromAMElementElement's rotation in degrees.
scaleType
numberInherited fromAMElementElement'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.
textContentType
stringInherited fromAMElementText contents of the SVG element.
xType
numberInherited fromAMElementElement's X position in pixels.
yType
numberInherited fromAMElementElement's Y position in pixels.
Methods
add(element:AMElement)Returns
voidAdds an element to group.
This will manipulate DOM.
elementwill be physically moved into group.addToBack(element:AMElement)Returns
voidAdds an element to group.
This will manipulate DOM.
elementwill be physically moved into group.constructor(elementName:string)Returns
GroupConstructor.
hasChild(element:AMElement)Returns
booleanChecks if this group already has the child element added
removeChildren()Returns
voidRemoves all children from the group.
removeElement(element:AMElement)Returns
voidRemoves the
elementfrom group.Please note that this will not dispose the element itself, it will just remove it from the group.
17 inherited items
addClass(name:string)Returns
voidInherited fromAMElementAdds a class to element.
addStyle(attributes:Object)Returns
AMElementInherited fromAMElementAdds style attributes to element's node.
attr(attributes:ISVGAttribute)Returns
AMElementInherited fromAMElementSets a set of attributes on a element.
attrNS(ns:string,
attribute:string,
value:string)Returns
AMElementInherited fromAMElementSets a single attribute of the element's node using namesspace.
dispose()Returns
voidInherited fromAMElementDisposes element.
getAttr(attribute:string)Returns
string|nullInherited fromAMElementReturns a value of a node attribute.
getAttrNS(ns:string,
attribute:string)Returns
stringInherited fromAMElementReturns a namespaced attribute value from node.
getBBox()Returns
IRectangleInherited fromAMElementReturns 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
stringInherited fromAMElementReturns style attribute value.
isDisposed()Returns
booleanInherited fromAMElementWas this element already been disposed?
moveTo(point:IPoint)Returns
voidInherited fromAMElementMoves the element to new coordinates.
removeAttr(attribute:string)Returns
voidInherited fromAMElementRemoves an attribute from element.
removeChildNodes()Returns
voidInherited fromAMElementRemoves all element's child nodes, basically leaving it empty.
removeClass(name:string)Returns
voidInherited fromAMElementRemoves a class from element.
removeNode()Returns
voidInherited fromAMElementRemoves element's node from DOM.
removeStyle(attribute:string)Returns
voidInherited fromAMElementRemoves
styleattribute from node.setClass(name:string)Returns
voidInherited fromAMElementSets a class name on element.
Events
Group does not have any events.