Skip to main content

Interface: IShapesGroupControllerApi

Charting Library.IShapesGroupControllerApi

Drawing Groups API. Refer to the Drawings API article for more information.

Methods​

addShapeToGroup​

addShapeToGroup(groupId, shapeId): void

Add a drawing to a group. The drawing takes the synchronization mode of the group.

Parameters​

NameTypeDescription
groupIdShapesGroupIdA group ID.
shapeIdEntityIdA drawing ID.

Returns​

void

If IShapesGroupControllerApi.canAddShapeToGroup is false for the pair.


availableZOrderOperations​

availableZOrderOperations(groupId): AvailableZOrderOperations

Get an object containing the available Z-order operations for a group.

Parameters​

NameTypeDescription
groupIdShapesGroupIdA group ID.

Returns​

AvailableZOrderOperations — The available Z-order operations.


bringForward​

bringForward(groupId): void

Move the group one level up in the Z-order.

Parameters​

NameTypeDescription
groupIdShapesGroupIdA group ID.

bringToFront​

bringToFront(groupId): void

Move the group to the top of the Z-order.

Parameters​

NameTypeDescription
groupIdShapesGroupIdA group ID.

canAddShapeToGroup​

canAddShapeToGroup(groupId, shapeId): boolean

Check whether a drawing may join a group. A drawing of an indicator cannot be synchronized, so it cannot join a group of synchronized drawings.

Parameters​

NameTypeDescription
groupIdShapesGroupIdA group ID.
shapeIdEntityIdA drawing ID.

Returns​

boolean — Whether IShapesGroupControllerApi.addShapeToGroup would succeed.


canBeGroupped​

canBeGroupped(shapes): boolean

Check if some drawings and groups of drawings can be grouped together.

Parameters​

NameTypeDescription
shapesreadonly (EntityId | ShapesGroupId)[]An array of drawing IDs and/or group IDs.

Returns​

boolean — true if the drawings can be grouped, false otherwise.


createGroupFromSelection​

createGroupFromSelection(): ShapesGroupId

Create a group of drawings from the selection.

Returns​

ShapesGroupId — The ID of the created group.

If selection is empty, or selection contains non-drawings, or selection contains drawings from more than one pane.


excludeShapeFromGroup​

excludeShapeFromGroup(groupId, shapeId): void

Remove a drawing from a group. If the drawing is the only drawing in the group then the group is also removed.

Parameters​

NameTypeDescription
groupIdShapesGroupIdA group ID.
shapeIdEntityIdA drawing ID.

getGroupName​

getGroupName(groupId): string

Get the name of a group.

Parameters​

NameTypeDescription
groupIdShapesGroupIdA group ID.

Returns​

string — The name of the group.


groupLock​

groupLock(groupId): GroupLockState

Get locked state of a group.

Parameters​

NameTypeDescription
groupIdShapesGroupIdA group ID.

Returns​

GroupLockState — The locked state.


groupVisibility​

groupVisibility(groupId): GroupVisibilityState

Get the visibility state of a group.

Parameters​

NameTypeDescription
groupIdShapesGroupIdA group ID.

Returns​

GroupVisibilityState — The visibility state.


groups​

groups(): readonly ShapesGroupId[]

Get an array of the top-level drawing groups. A group nested into another one is not returned here, ask IShapesGroupControllerApi.subgroups of its parent for it.

Returns​

readonly ShapesGroupId[] — An array of group IDs.


insertAfter​

insertAfter(groupId, target): void

Move the group immediately below the target in the Z-order.

Parameters​

NameTypeDescription
groupIdShapesGroupIdA group ID.
targetEntityId | ShapesGroupIdA target ID.

insertBefore​

insertBefore(groupId, target): void

Move the group immediately above the target in the Z-order.

Parameters​

NameTypeDescription
groupIdShapesGroupIdA group ID.
targetEntityId | ShapesGroupIdA target ID.

removeGroup​

removeGroup(groupId): void

Remove a group of drawings.

Parameters​

NameTypeDescription
groupIdShapesGroupIdA group ID.

sendBackward​

sendBackward(groupId): void

Move the group one level down in the Z-order.

Parameters​

NameTypeDescription
groupIdShapesGroupIdA group ID.

sendToBack​

sendToBack(groupId): void

Move the group to the bottom of the Z-order.

Parameters​

NameTypeDescription
groupIdShapesGroupIdA group ID.

setGroupLock​

setGroupLock(groupId, value): void

Lock or unlock a group.

Parameters​

NameTypeDescription
groupIdShapesGroupIdA group ID.
valuebooleanA boolean flag. true to lock, false to unlock.

setGroupName​

setGroupName(groupId, name): void

Set the name of a group. Names do not need to be unique.

Parameters​

NameTypeDescription
groupIdShapesGroupIdA group ID.
namestringThe new name of the group.

setGroupVisibility​

setGroupVisibility(groupId, value): void

Show or hide all drawings in a group.

Parameters​

NameTypeDescription
groupIdShapesGroupIdA group ID.
valuebooleanA boolean flag. true to show, false to hide.

shapesInGroup​

shapesInGroup(groupId): readonly EntityId[]

Get an array of IDs for each drawing that belongs to a group directly. A drawing of a nested group is not returned here, walk the tree with IShapesGroupControllerApi.subgroups.

Parameters​

NameTypeDescription
groupIdShapesGroupIdA group ID.

Returns​

readonly EntityId[] — An array of drawing IDs.