LegendBoxAddOptions: {
    builder?: UIElementBuilder<LegendBoxEntry>;
    matchStyleExactly?: boolean;
    toggleVisibilityOnClick?: boolean;
}

Optional configuration options that can be supplied when adding entries to a LegendBox.

 // Example, prevent toggling visibility on click.
LegendBox.add(component, { toggleVisibilityOnClick: false })
 // Example, specify point shape in legend
LegendBox.add(component, { builder: UIElementBuilders.CheckBox.setButtonShape(PointShape.Star) })
 // Example, match component style exactly instead of assigning a built-in gradient
LegendBox.add(component, { matchStyleExactly: true })

Type declaration

  • Optional builder?: UIElementBuilder<LegendBoxEntry>

    Optional builder for custom entry

     // Example, specify point shape in legend
    LegendBox.add(component, { builder: UIElementBuilders.CheckBox.setButtonShape(PointShape.Star) })
  • Optional matchStyleExactly?: boolean

    By default, entries are assigned a smooth looking gradient based on the component color. If this flag is true, then this is skipped, and exact component solid fill is used instead.

     // Example, match component style exactly instead of assigning a built-in gradient
    LegendBox.add(component, { matchStyleExactly: true })
  • Optional toggleVisibilityOnClick?: boolean

    Optional flag that determines whether clicking the LegendBoxEntry will dispose the Attached objects

     // Example, prevent toggling visibility on click.
    LegendBox.add(component, { toggleVisibilityOnClick: false })