documentationfor yFiles for HTML 2.6

IconLabelStyle

A label style that wraps another ILabelStyle and draws an icon in addition to the text.

Inheritance Hierarchy
IconLabelStyle
Implemented Interfaces

Remarks

This style draws the icon at the location specified by iconPlacement and delegates the drawing of the label's text and background to the wrapped style.

Note that in addition to the icon the iconSize has to be set, otherwise the icon cannot be rendered.

Examples

const labelStyle = new IconLabelStyle({
  icon: 'icon.svg',
  iconSize: [16, 16],
  iconPlacement: InteriorLabelModel.WEST,
  wrapped: new DefaultLabelStyle({
    backgroundFill: Fill.LIGHT_GRAY,
    backgroundStroke: Stroke.BLACK
  })
})
graph.addLabel(node, 'Label Text', ExteriorLabelModel.SOUTH, labelStyle)

Type Details

yfiles module
view-component
yfiles-umd modules
All view modules
Legacy UMD name
yfiles.styles.IconLabelStyle

See Also

The iconSize must be set to a non-EMPTY value, otherwise the icon will not be rendered.

Constructors

Properties

Methods