Element: <oj-legend-section>

Oracle® JavaScript Extension Toolkit (JET)


  • 6.0.0
  • ojlegend



Other Topics

JET Legend Section

The oj-legend-section element is used to declare properties for legend sections and is only valid as the child of a template element for the sectionTemplate slot of oj-legend.

<oj-legend data='[[dataProvider]]'>
 <template slot='sectionTemplate'>
   <oj-legend-section  collapsible='on' expanded='[[$current.index == 0 ? "on" : "off"]]'>


Read about current Core Pack limitations to decide when to migrate.
Please make note of the following:

  • Deprecated APIs are not available in Core Pack, and are not documented in this migration section.
  • Before trying to migrate to Core Pack run the JET audits and fix any issues before proceeding.
  • The refresh() method is no longer supported in Core Pack. See the Core Pack Migration Guide for more information.

To migrate from oj-legend-section to oj-c-legend-section, you need to revise the import statement and references to oj-legend-section in your app. Please note the changes between the two components below.
collapsible attribute

For the initial versions of oj-c-legend and oj-c-legend-section, collapsible attribute is not supported.

sectionTemplate slot

For the initial version of oj-c-legend, nested section is not supported. $current of sectionTemplate context will not contain parentKey and parentData properties.



interface LegendSectionElement

Typescript Import Format
//To typecheck the element APIs, import as below.
import { LegendSectionElement } from "ojs/ojlegend";

//For the transpiled javascript to load the element's module, import as below
import "ojs/ojlegend";

For additional information visit:


collapsible :"on"|"off"

Whether the section is collapsible. Only applies if the legend orientation is vertical.
Since Description
16.0.0 Use of legend collapsible section is not recommended in Redwood theme. As such, this attribute is deprecated.
Supported Values:
Value Description
off The legend section will not be collapsible.
on The legend section will be collapsible.
Default Value:
  • "off"

text :string

The title of the legend section.
Default Value:
  • ""

text-halign :"center"|"end"|"start"

The horizontal alignment of the section title. If the section is collapsible or nested, only start alignment is supported.
Since Description
15.1.0 Individual section title alignment is no longer supported. Use section-title-halign in oj-legend to align all section titles
Supported Values:
Value Description
center The section title will be center aligned.
end The section title will be end aligned.
start The section title will be start aligned.

text-style :Partial<CSSStyleDeclaration>

The CSS style object defining the style of the section title. The following style properties are supported: color, cursor, fontFamily, fontSize, fontStyle, fontWeight, textDecoration.
Since Description
15.1.0 Individual section title style is no longer supported. Use section-title-style in oj-legend to style all section titles
Default Value:
  • {}