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.
Parameters
| Name | Type | Description |
|---|---|---|
groupId | ShapesGroupId | A group ID. |
shapeId | EntityId | A drawing ID. |
availableZOrderOperations
availableZOrderOperations(groupId): AvailableZOrderOperations
Get an object containing the available Z-order operations for a group.
Parameters
| Name | Type | Description |
|---|---|---|
groupId | ShapesGroupId | A group ID. |
Returns
AvailableZOrderOperations — The available Z-order operations.
bringForward
bringForward(groupId): void
Move the group one level up in the Z-order.
Parameters
| Name | Type | Description |
|---|---|---|
groupId | ShapesGroupId | A group ID. |
bringToFront
bringToFront(groupId): void
Move the group to the top of the Z-order.
Parameters
| Name | Type | Description |
|---|---|---|
groupId | ShapesGroupId | A group ID. |
canBeGroupped
canBeGroupped(shapes): boolean
Check if some drawings can be grouped.
Parameters
| Name | Type | Description |
|---|---|---|
shapes | readonly EntityId[] | An array of drawing 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.
Throws
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
| Name | Type | Description |
|---|---|---|
groupId | ShapesGroupId | A group ID. |
shapeId | EntityId | A drawing ID. |
getGroupName
getGroupName(groupId): string
Get the name of a group.
Parameters
| Name | Type | Description |
|---|---|---|
groupId | ShapesGroupId | A group ID. |
Returns
string — The name of the group.
groupLock
groupLock(groupId): GroupLockState
Get locked state of a group.
Parameters
| Name | Type | Description |
|---|---|---|
groupId | ShapesGroupId | A group ID. |
Returns
GroupLockState — The locked state.
groupVisibility
groupVisibility(groupId): GroupVisibilityState
Get the visibility state of a group.
Parameters
| Name | Type | Description |
|---|---|---|
groupId | ShapesGroupId | A group ID. |
Returns
GroupVisibilityState — The visibility state.
groups
groups(): readonly ShapesGroupId[]
Get an array of all drawing groups.
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
| Name | Type | Description |
|---|---|---|
groupId | ShapesGroupId | A group ID. |
target | EntityId | ShapesGroupId | A target ID. |
insertBefore
insertBefore(groupId, target): void
Move the group immediately above the target in the Z-order.
Parameters
| Name | Type | Description |
|---|---|---|
groupId | ShapesGroupId | A group ID. |
target | EntityId | ShapesGroupId | A target ID. |
removeGroup
removeGroup(groupId): void
Remove a group of drawings.
Parameters
| Name | Type | Description |
|---|---|---|
groupId | ShapesGroupId | A group ID. |
sendBackward
sendBackward(groupId): void
Move the group one level down in the Z-order.
Parameters
| Name | Type | Description |
|---|---|---|
groupId | ShapesGroupId | A group ID. |
sendToBack
sendToBack(groupId): void
Move the group to the bottom of the Z-order.
Parameters
| Name | Type | Description |
|---|---|---|
groupId | ShapesGroupId | A group ID. |
setGroupLock
setGroupLock(groupId, value): void
Lock or unlock a group.
Parameters
| Name | Type | Description |
|---|---|---|
groupId | ShapesGroupId | A group ID. |
value | boolean | A 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
| Name | Type | Description |
|---|---|---|
groupId | ShapesGroupId | A group ID. |
name | string | The new name of the group. |
setGroupVisibility
setGroupVisibility(groupId, value): void
Show or hide all drawings in a group.
Parameters
| Name | Type | Description |
|---|---|---|
groupId | ShapesGroupId | A group ID. |
value | boolean | A boolean flag. true to show, false to hide. |
shapesInGroup
shapesInGroup(groupId): readonly EntityId[]
Get an array of IDs for each drawing in a group.
Parameters
| Name | Type | Description |
|---|---|---|
groupId | ShapesGroupId | A group ID. |
Returns
readonly EntityId[] — An array of drawing IDs.