Element: <oj-picto-chart>

Oracle® JavaScript Extension Toolkit (JET)
5.0.0

E90577-01

QuickNav

Attributes


Context Objects

JET Custom Elements

JET components are implemented as custom HTML elements. In addition to the component attributes documented in this page, JET components also support standard HTML global attributes like id and aria-label.

The JET data binding syntax can be used to define both component and global attributes through the use of dynamically evaluated expressions. All attributes (component and global) support attribute-level binding by prefixing the attribute name with ":" (e.g. :id="[...]"). When using attribute-level binding, all expression values are treated as strings. Additionally, component attributes support property-level binding by using the attribute name directly with no ":" prefix. When using property-level binding, the expressions should evaluate to the types documented by the corresponding attributes. Property-level binding is strongly recommended over attribute-level binding for component attributes.

A detailed description of working with custom HTML elements can be found in: JET Custom Element Usage.


PREVIEW: This is a preview API. Preview APIs are production quality, but can be changed on a major version without a deprecation path.

Version:
  • 5.0.0
Since:
  • 1.2.0
Module:
  • ojpictochart

JET PictoChart

PictoChart uses icons to visualize an absolute number, or the relative sizes of the different parts of a population.


<oj-picto-chart
  items='[{"name": "Red", "shape": "human", "color": "#ed6647", "count": 3},
         {"name": "Blue", "shape": "circle", "color": "#267db3", "count": 17}]'>
</oj-picto-chart>

Accessibility

The application is responsible for populating the shortDesc value in the component properties object with meaningful descriptors when the component does not provide a default descriptor. Since component terminology for keyboard and touch shortcuts can conflict with those of the application, it is the application's responsibility to provide these shortcuts, possibly via a help popup.

When using colors as a data dimension for PictoChart, the application needs to ensure that they meet minimum contrast requirements. Not all colors in the default value ramp provided by oj.ColorAttributeGroupHandler will meet minimum contrast requirements.

Touch End User Information

Target Gesture Action
Data Item Tap Select when selectionMode is enabled.
Drill when drilling is enabled and selectionMode is none.
Double Tap Drill when drilling is enabled and selectionMode is enabled.
Press & Hold Display tooltip.
Display context menu on release.

Keyboard End User Information

Key Action
Tab Move focus to next element.
Shift + Tab Move focus to previous element.
UpArrow Move focus and selection to previous item.
DownArrow Move focus and selection to next item.
LeftArrow Move focus and selection to previous item.
RightArrow Move focus and selection to next item.
Shift + UpArrow Move focus and multi-select previous item.
Shift + DownArrow Move focus and multi-select next item.
Shift + LeftArrow Move focus and multi-select previous item.
Shift + RightArrow Move focus and multi-select next item.
Ctrl + UpArrow Move focus to previous item, without changing the current selection.
Ctrl + DownArrow Move focus to next item, without changing the current selection.
Ctrl + LeftArrow Move focus to previous item, without changing the current selection.
Ctrl + RightArrow Move focus to next item, without changing the current selection.
Ctrl + Spacebar Multi-select item with focus.
Enter Drill on item when drilling is enabled.

Performance

Animation

Animation should only be enabled for visualizations of small to medium data sets. Alternate visualizations should be considered if identifying data changes is important, since all data items will generally move and resize on any data change.

Tracking Resize

By default, the element will track resizes and render at the new size. This functionality adds a small overhead to the initial render for simple elements like gauges or spark charts, which become noticable when using large numbers of these simple elements. To disable resize tracking, set trackResize to off. The application can manually request a re-render at any time by calling the refresh function.

Layout

Fixed and Flowing Layout

PictoChart supports both fixed and flowing layout. If the element has a fixed width and height (set by the inline style, style class, etc.), then the pictoChart will use a fixed layout, which means that the shapes will be resized to occupy the given space as much as possible. Otherwise, the pictoChart will use a flowing layout, which means that the shapes are rendered at a constant size and the element will take up as much space as necessary. It is possible to fix just one of the two dimensions, and the pictoChart would still use the flowing layout.

If fixed layout is used, please avoid using the rowHeight and columnWidth attributes as they may cause the shapes to be dropped if the given space is not large enough.

Layout Orientation and Origin

PictoChart currently supports rectangular layouts with two different orientations (horizontal and vertical) and four different origins (topStart, topEnd, bottomStart, and bottomEnd). Please refer to the cookbook demo to see how these layout attributes work.

Mixed Sizes

PictoChart supports items that are varying in sizes by specifying the columnSpan and rowSpan attributes on the items. To ensure the best layout, it is recommended that the bigger items are ordered first because the layout algorithm is greedy and will position items to the first available space.

Reading direction

As with any JET component, in the unusual case that the directionality (LTR or RTL) changes post-init, the component must be refresh()ed.

Note: Application logic should not interact with the component's properties or invoke its methods until the BusyContext indicates that the component is ready for interaction.

Slots

JET elements can have up to two types of child content:

  • Any child element with a slot attribute will be moved into that named slot, e.g. <span slot='startIcon'>...</span>. All supported named slots are documented below. Child elements with unsupported named slots will be removed from the DOM.
  • Any child element lacking a slot attribute will be moved to the default slot, also known as a regular child.

contextMenu

The contextMenu slot is set on the oj-menu within this element. This is used to designate the JET Menu that this component should launch as a context menu on right-click, Shift-F10, Press & Hold, or component-specific gesture. If specified, the browser's native context menu will be replaced by the JET Menu specified in this slot.

The application can register a listener for the Menu's ojBeforeOpen event. The listener can cancel the launch via event.preventDefault(), or it can customize the menu contents by editing the menu DOM directly, and then calling refresh() on the Menu.

To help determine whether it's appropriate to cancel the launch or customize the menu, the ojBeforeOpen listener can use component API's to determine which table cell, chart item, etc., is the target of the context menu. See the JSDoc and demos of the individual components for details.

Keep in mind that any such logic must work whether the context menu was launched via right-click, Shift-F10, Press & Hold, or component-specific touch gesture.

Example

Initialize the component with a context menu:

<oj-some-element>
    <-- use the contextMenu slot to designate this as the context menu for this component -->
    <oj-menu slot="contextMenu" style="display:none" aria-label="Some element's context menu">
...
    </oj-menu>
</oj-some-element>

Attributes

animation-duration :number

The duration of the animations, in milliseconds. The default value comes from the CSS and varies based on theme.
Names
Item Name
Property animationDuration
Property change event animationDurationChanged
Property change listener attribute (must be of type function) on-animation-duration-changed

animation-on-data-change :string

The animation when the data changes.
Supported Values:
Name Type
"auto" string
"none" string
Default Value:
  • "none"
Names
Item Name
Property animationOnDataChange
Property change event animationOnDataChangeChanged
Property change listener attribute (must be of type function) on-animation-on-data-change-changed

animation-on-display :string

The animation that is shown on initial display.
Supported Values:
Name Type
"alphaFade" string
"auto" string
"none" string
"popIn" string
"zoom" string
Default Value:
  • "none"
Names
Item Name
Property animationOnDisplay
Property change event animationOnDisplayChanged
Property change listener attribute (must be of type function) on-animation-on-display-changed

column-count :number|null

The number of columns that the picto chart has. The number of columns will be automatically computed if not specified.
Default Value:
  • null
Names
Item Name
Property columnCount
Property change event columnCountChanged
Property change listener attribute (must be of type function) on-column-count-changed

column-width :number|null

The width of a column in pixels. The width of columns will be automatically computed if not specified. Setting this property in a fixed layout (when the element width and height are defined) may cause items to be truncated.
Default Value:
  • null
Names
Item Name
Property columnWidth
Property change event columnWidthChanged
Property change listener attribute (must be of type function) on-column-width-changed

drilling :string

Whether drilling is enabled. Drillable items will show a pointer cursor on hover and fire an ojDrill event on click (double click if selection is enabled). To enable or disable drilling on individual items, use the drilling attribute in each item.
Supported Values:
Name Type
"off" string
"on" string
Default Value:
  • "off"
Names
Item Name
Property drilling
Property change event drillingChanged
Property change listener attribute (must be of type function) on-drilling-changed

hidden-categories :Array.<string>

An array of category strings used for category filtering. Data items with a category in hiddenCategories will be filtered.
Default Value:
  • []
Supports writeback:
  • true
Names
Item Name
Property hiddenCategories
Property change event hiddenCategoriesChanged
Property change listener attribute (must be of type function) on-hidden-categories-changed

highlight-match :string

The matching condition for the highlightedCategories property. By default, highlightMatch is 'all' and only items whose categories match all of the values specified in the highlightedCategories array will be highlighted. If highlightMatch is 'any', then items that match at least one of the highlightedCategories values will be highlighted.
Supported Values:
Name Type
"all" string
"any" string
Default Value:
  • "all"
Names
Item Name
Property highlightMatch
Property change event highlightMatchChanged
Property change listener attribute (must be of type function) on-highlight-match-changed

highlighted-categories :Array.<string>

An array of category strings used for category highlighting. Data items with a category in highlightedCategories will be highlighted.
Default Value:
  • []
Supports writeback:
  • true
Names
Item Name
Property highlightedCategories
Property change event highlightedCategoriesChanged
Property change listener attribute (must be of type function) on-highlighted-categories-changed

hover-behavior :string

The behavior applied when hovering over data items.
Supported Values:
Name Type
"dim" string
"none" string
Default Value:
  • "none"
Names
Item Name
Property hoverBehavior
Property change event hoverBehaviorChanged
Property change listener attribute (must be of type function) on-hover-behavior-changed

hover-behavior-delay :number

Specifies initial hover delay in ms for highlighting data items.
Default Value:
  • 200
Names
Item Name
Property hoverBehaviorDelay
Property change event hoverBehaviorDelayChanged
Property change listener attribute (must be of type function) on-hover-behavior-delay-changed

items :Array.<Object>|Promise|null

An array of objects with the following properties that defines the pictoChart items.
Default Value:
  • null
Names
Item Name
Property items
Property change event itemsChanged
Property change listener attribute (must be of type function) on-items-changed

items[].borderColor :string

The border color of the item. Does not apply if custom image is specified.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

items[].borderWidth :number

The border width of the item in pixels. Does not apply if custom image is specified.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

items[].categories :Array.<string>

An array of category strings corresponding to this item. If not specified, defaults to the item id or name. This enables highlighting and filtering of individual data items through interactions with other visualization elements.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

items[].color :string

The color of the item. Does not apply if custom image is specified.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

items[].columnSpan :number

The number of columns each shape (or custom image) spans. Used for creating a pictoChart with mixed item sizes.
Default Value:
  • 1
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

items[].count :number

Specifies the number of times that the shape (or custom image) is drawn. Fractional counts (such as 4.5) are supported; however, fractions other than the multiples of 0.5 should be avoided because the fractional rendering ignores the gaps between shapes and the irregularity of the shapes.
Default Value:
  • 1
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

items[].drilling :string

Whether drilling is enabled for the item. Drillable items will show a pointer cursor on hover and fire an ojDrill event on click (double click if selection is enabled). To enable drilling for all items at once, use the drilling attribute in the top level.
Supported Values:
Name Type
"inherit" string
"off" string
"on" string
Default Value:
  • "inherit"
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

items[].id :string

The id of the item.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

items[].name :string

The name of the item. Used for default tooltip and accessibility.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

items[].rowSpan :number

The number of rows each shape (or custom image) spans. Used for creating a pictoChart with mixed item sizes.
Default Value:
  • 1
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

items[].shape :string

The shape of the item. Can take the name of a built-in shape or the svg path commands for a custom shape. "None" will make the item transparent and can be used to create gaps. Does not apply if custom image is specified.
Supported Values:
Name Type
"circle" string
"diamond" string
"ellipse" string
"human" string
"none" string
"plus" string
"rectangle" string
"square" string
"star" string
"triangleDown" string
"triangleUp" string
Default Value:
  • "rectangle"
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

items[].shortDesc :string

Short description string for accessibility users.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

items[].source :string

The URI of the custom image. If specified, it takes precedence over shape.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

items[].sourceHover :string

The optional URI for the hover state. If not specified, the source image will be used.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

items[].sourceHoverSelected :string

The optional URI for the hover selected state. If not specified, the source image will be used.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

items[].sourceSelected :string

The optional URI for the selected state. If not specified, the source image will be used.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

items[].svgClassName :string

The CSS style class to apply to the item. The style class and inline style will override any other styling specified with other properties. For tooltip interactivity, it's recommended to also pass a representative color to the item color attribute. Does not apply if custom image is specified.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

items[].svgStyle :Object

The inline style to apply to the item. The style class and inline style will override any other styling specified with other properties. For tooltip interactivity, it's recommended to also pass a representative color to the item color attribute. Does not apply if custom image is specified.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

layout :string

The direction in which the items are laid out.
Supported Values:
Name Type
"horizontal" string
"vertical" string
Default Value:
  • "horizontal"
Names
Item Name
Property layout
Property change event layoutChanged
Property change listener attribute (must be of type function) on-layout-changed

layout-origin :string

Defines where the first item is rendered. The subsequent items follow the first item according to the layout.
Supported Values:
Name Type
"bottomEnd" string
"bottomStart" string
"topEnd" string
"topStart" string
Default Value:
  • "topStart"
Names
Item Name
Property layoutOrigin
Property change event layoutOriginChanged
Property change listener attribute (must be of type function) on-layout-origin-changed

row-count :number|null

The number of rows that the picto chart has. The number of rows will be automatically computed if not specified.
Default Value:
  • null
Names
Item Name
Property rowCount
Property change event rowCountChanged
Property change listener attribute (must be of type function) on-row-count-changed

row-height :number|null

The height of a row in pixels. The height of rows will be automatically computed if not specified. Setting this property in a fixed layout (when the element width and height are defined) may cause items to be truncated.
Default Value:
  • null
Names
Item Name
Property rowHeight
Property change event rowHeightChanged
Property change listener attribute (must be of type function) on-row-height-changed

selection :Array.<string>

An array of id strings, used to define the selected objects.
Default Value:
  • []
Supports writeback:
  • true
Names
Item Name
Property selection
Property change event selectionChanged
Property change listener attribute (must be of type function) on-selection-changed

selection-mode :string

The type of selection behavior that is enabled on the picto chart.
Supported Values:
Name Type
"multiple" string
"none" string
"single" string
Default Value:
  • "none"
Names
Item Name
Property selectionMode
Property change event selectionModeChanged
Property change listener attribute (must be of type function) on-selection-mode-changed

tooltip :Object

A function that returns a custom tooltip. The function takes a dataContext argument, provided by the picto chart. The function should return an Object that contains only one of the two properties:
  • insert: HTMLElement | string - An HTML element, which will be appended to the tooltip, or a tooltip string.
  • preventDefault: true - Indicates that the tooltip should not be displayed. It is not necessary to return {preventDefault:false} to display tooltip, since this is a default behavior.
Default Value:
  • {"renderer": null}
Names
Item Name
Property tooltip
Property change event tooltipChanged
Property change listener attribute (must be of type function) on-tooltip-changed

tooltip.renderer :((context: oj.ojPictoChart.TooltipContext) => ({insert: Element|string}|{preventDefault: boolean}))|null

Default Value:
  • null
Names
Item Name
Property tooltip.renderer

track-resize :string

Defines whether the element will automatically render in response to changes in size. If set to off, then the application is responsible for calling refresh to render the element at the new size.
Supported Values:
Name Type
"off" string
"on" string
Default Value:
  • "on"
Names
Item Name
Property trackResize
Property change event trackResizeChanged
Property change listener attribute (must be of type function) on-track-resize-changed
Examples

Initialize the data visualization element with the track-resize attribute specified:

<oj-some-dvt track-resize='off'></oj-some-dvt>

Get or set the trackResize property after initialization:

// getter
var value = myComponent.trackResize;

// setter
myComponent.trackResize="off";

translations :Object|null

A collection of translated resources from the translation bundle, or null if this component has no resources. Resources may be accessed and overridden individually or collectively, as seen in the examples.

If the component does not contain any translatable resource, the default value of this attribute will be null. If not, an object containing all resources relevant to the component.

If this component has translations, their documentation immediately follows this doc entry.

Names
Item Name
Property translations
Property change event translationsChanged
Property change listener attribute (must be of type function) on-translations-changed
Examples

Initialize the component, overriding some translated resources and leaving the others intact:

<!-- Using dot notation -->
<oj-some-element translations.some-key='some value' translations.some-other-key='some other value'></oj-some-element>

<!-- Using JSON notation -->
<oj-some-element translations='{"someKey":"some value", "someOtherKey":"some other value"}'></oj-some-element>

Get or set the translations property after initialization:

// Get one
var value = myComponent.translations.someKey;

// Set one, leaving the others intact. Always use the setProperty API for 
// subproperties rather than setting a subproperty directly.
myComponent.setProperty('translations.someKey', 'some value');

// Get all
var values = myComponent.translations;

// Set all.  Must list every resource key, as those not listed are lost.
myComponent.translations = {
    someKey: 'some value',
    someOtherKey: 'some other value'
};

(nullable) translations.component-name :string

Used to describe the data visualization type for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Picture Chart"
Names
Item Name
Property translations.componentName

(nullable) translations.label-and-value :string

Used to display a label and its value.

See the translations attribute for usage examples.

Default Value:
  • "{0}: {1}"
Names
Item Name
Property translations.labelAndValue

(nullable) translations.label-clear-selection :string

Text shown for clearing multiple selection on touch devices.

See the translations attribute for usage examples.

Default Value:
  • "Clear Selection"
Names
Item Name
Property translations.labelClearSelection

(nullable) translations.label-count-with-total :string

Used to display a count out of a total.

See the translations attribute for usage examples.

Default Value:
  • "{0} of {1}"
Names
Item Name
Property translations.labelCountWithTotal

(nullable) translations.label-data-visualization :string

Label for data visualizations used for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Data Visualization"
Names
Item Name
Property translations.labelDataVisualization

(nullable) translations.label-invalid-data :string

Text shown when the component receives invalid data.

See the translations attribute for usage examples.

Default Value:
  • "Invalid data"
Names
Item Name
Property translations.labelInvalidData

(nullable) translations.label-no-data :string

Text shown when the component receives no data.

See the translations attribute for usage examples.

Default Value:
  • "No data to display"
Names
Item Name
Property translations.labelNoData

(nullable) translations.state-collapsed :string

Used to describe the collapsed state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Collapsed"
Names
Item Name
Property translations.stateCollapsed

(nullable) translations.state-drillable :string

Used to describe a drillable object for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Drillable"
Names
Item Name
Property translations.stateDrillable

(nullable) translations.state-expanded :string

Used to describe the expanded state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Expanded"
Names
Item Name
Property translations.stateExpanded

(nullable) translations.state-hidden :string

Used to describe the hidden state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Hidden"
Names
Item Name
Property translations.stateHidden

(nullable) translations.state-isolated :string

Used to describe the isolated state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Isolated"
Names
Item Name
Property translations.stateIsolated

(nullable) translations.state-maximized :string

Used to describe the maximized state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Maximized"
Names
Item Name
Property translations.stateMaximized

(nullable) translations.state-minimized :string

Used to describe the minimized state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Minimized"
Names
Item Name
Property translations.stateMinimized

(nullable) translations.state-selected :string

Used to describe the selected state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Selected"
Names
Item Name
Property translations.stateSelected

(nullable) translations.state-unselected :string

Used to describe the unselected state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Unselected"
Names
Item Name
Property translations.stateUnselected

(nullable) translations.state-visible :string

Used to describe the visible state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Visible"
Names
Item Name
Property translations.stateVisible

Context Objects

Each context object contains, at minimum, a subId property, whose value is a string that identifies a particular DOM node in this element. It can have additional properties to further specify the desired node. See getContextByNode for more details.

Properties:
Name Type Description
subId string Sub-id string to identify a particular dom node.

Following are the valid subIds:

oj-pictochart-item

Context for tag cloud items at a specified index.

Properties:
Name Type
index number

Events

ojDrill

Triggered during a drill gesture (double click if selection is enabled, single click otherwise).
Properties:

All of the event payloads listed below can be found under event.detail.

Name Type Description
id string the id of the drilled object
Examples

Specify an ojDrill listener via the DOM attribute:

<oj-picto-chart on-oj-drill='[[listener]]'></oj-picto-chart>

Specify an ojDrill listener via the JavaScript property:

myPictoChart.onOjDrill = listener;

Add an ojDrill listener via the addEventListener API:

myPictoChart.addEventListener('ojDrill', listener);

Methods

getContextByNode(node) → {(oj.ojPictoChart.NodeContext|null)}

Returns an object with context for the given child DOM node. This will always contain the subid for the node, defined as the 'subId' property on the context object. Additional component specific information may also be included. For more details on returned objects, see context objects.
Parameters:
Name Type Argument Description
node Element <not nullable>
The child DOM node
Returns:
The context for the DOM node, or null when none is found.
Type
(oj.ojPictoChart.NodeContext|null)
Example
// Returns {'subId': 'oj-some-sub-id', 'componentSpecificProperty': someValue, ...}
var context = myComponent.getContextByNode(nodeInsideElement);

getItem(index) → {(oj.ojPictoChart.ItemContext|null)}

Returns an object with the following properties for automation testing verification of the item at the specified index.
Parameters:
Name Type Description
index number The index.
Returns:
An object containing data for the item at the given index, or null if none exists.
Type
(oj.ojPictoChart.ItemContext|null)

getItemCount() → {number}

Returns the number of items in the pictoChart data.
Returns:
The number of data items
Type
number

getProperty(property) → {*}

Retrieves a value for a property or a single subproperty for complex properties.
Parameters:
Name Type Description
property string The property name to get. Supports dot notation for subproperty access.
Since:
  • 4.0.0
Returns:
Type
*
Example

Get a single subproperty of a complex property:

var subpropValue = myComponent.getProperty('complexProperty.subProperty1.subProperty2');

refresh() → {void}

Refreshes the component.
Returns:
Type
void

setProperties(properties) → {void}

Performs a batch set of properties.
Parameters:
Name Type Description
properties Object An object containing the property and value pairs to set.
Since:
  • 4.0.0
Returns:
Type
void
Example

Set a batch of properties:

myComponent.setProperties({"prop1": "value1", "prop2.subprop": "value2", "prop3": "value3"});

setProperty(property, value) → {void}

Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a [property]Changed event.
Parameters:
Name Type Description
property string The property name to set. Supports dot notation for subproperty access.
value * The new value to set the property to.
Since:
  • 4.0.0
Returns:
Type
void
Example

Set a single subproperty of a complex property:

myComponent.setProperty('complexProperty.subProperty1.subProperty2', "someValue");

Type Definitions

Item

Properties:
Name Type Argument Default Description
id string <optional>
The id of the item.
name string <optional>
The name of the item. Used for default tooltip and accessibility.
shape "ellipse" | "square" | "circle" | "diamond" | "triangleUp" | "triangleDown" | "star" | "plus" | "human" | "none" | "rectangle" | string <optional>
"rectangle" The shape of the item. Can take the name of a built-in shape or the svg path commands for a custom shape. "None" will make the item transparent and can be used to create gaps. Does not apply if custom image is specified.
color string <optional>
The color of the item. Does not apply if custom image is specified.
borderColor string <optional>
The border color of the item. Does not apply if custom image is specified.
borderWidth number <optional>
The border width of the item in pixels. Does not apply if custom image is specified.
source string <optional>
The URI of the custom image. If specified, it takes precedence over shape.
svgClassName string <optional>
The CSS style class to apply to the item. The style class and inline style will override any other styling specified with other properties. For tooltip interactivity, it's recommended to also pass a representative color to the item color attribute. Does not apply if custom image is specified.
svgStyle Object <optional>
The inline style to apply to the item. The style class and inline style will override any other styling specified with other properties. For tooltip interactivity, it's recommended to also pass a representative color to the item color attribute. Does not apply if custom image is specified.
sourceHover string <optional>
The optional URI for the hover state. If not specified, the source image will be used.
sourceSelected string <optional>
The optional URI for the selected state. If not specified, the source image will be used.
sourceHoverSelected string <optional>
The optional URI for the hover selected state. If not specified, the source image will be used.
count number <optional>
Specifies the number of times that the shape (or custom image) is drawn. Fractional counts (such as 4.5) are supported; however, fractions other than the multiples of 0.5 should be avoided because the fractional rendering ignores the gaps between shapes and the irregularity of the shapes.
rowSpan number <optional>
The number of rows each shape (or custom image) spans. Used for creating a pictoChart with mixed item sizes.
columnSpan number <optional>
The number of columns each shape (or custom image) spans. Used for creating a pictoChart with mixed item sizes.
shortDesc string <optional>
Short description string for accessibility users.
categories Array.<string> <optional>
An array of category strings corresponding to this item. If not specified, defaults to the item id or name. This enables highlighting and filtering of individual data items through interactions with other visualization elements.
drilling "inherit" | "off" | "on" <optional>
"inherit" Whether drilling is enabled for the item. Drillable items will show a pointer cursor on hover and fire an ojDrill event on click (double click if selection is enabled). To enable drilling for all items at once, use the drilling attribute in the top level.

ItemContext

Properties:
Name Type
color string
count number
id string
name string
selected boolean
tooltip string

NodeContext

Properties:
Name Type Description
subId string The subId string identify the particular DOM node.
index number The zero based index of the picto chart item.

TooltipContext

Properties:
Name Type Description
parentElement Element The tooltip element. The function can directly modify or append content to this element.
id string The id of the hovered item.
name string The name of the hovered item.
count number The count of the hovered item.
color string The color of the hovered item.
componentElement Element The picto chart HTML element.