Usage
Signature:
interface CAreaChartElement<K extends string | number,D extends oj-c.AreaChart.AreaItem<K> | any>
Typescript Import Format
//To typecheck the element APIs, import as below.
import { CAreaChartElement } from "oj-c/area-chart";
//For the transpiled javascript to load the element's module, import as below
import "oj-c/area-chart";
For additional information visit:
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 components that allow child content support slots. Please see the slots section of the JET component overview doc for more information on allowed slot content and slot types.
-
groupTemplate
-
The
groupTemplateslot is used to specify the template for generating the group properties of the chart. The slot content must be a single <template> element. The content of the template should only be one <oj-c-area-chart-group> element. See the oj-c-area-chart-group doc for more details.When the template is executed for each group, it will have access to the chart's binding context containing the following properties:
- $current - an object that contains information for the current item. (See the table below for a list of properties available on $current)
- alias - if as attribute was specified, the value will be used to provide an application-named alias for $current.
Properties of $current:
Name Type Description depthnumber The depth of the group. The depth of the outermost group under the invisible root is 1. idsArray<string> The key of the current item. indexnumber The group index itemsArray.<oj-c.AreaChart.ChartItemTemplateContext> The array of objects which are chart items that belong to this series. The objects will have the following properties -
itemTemplate
-
The
itemTemplateslot is used to specify the template for creating each item of the chart. The slot content must be a <template> element. The content of the template should only be one <oj-c-area-chart-item> element. See the oj-c-area-chart-item doc for more details. A series-id and group-id must be specified.When the template is executed for each item, it will have access to the chart's binding context containing the following properties:
- $current - an object that contains information for the current item. (See the table below for a list of properties available on $current)
- alias - if as attribute was specified, the value will be used to provide an application-named alias for $current.
Properties of $current:
Name Type Description dataD The data object of the current item. indexnumber The zero-based index of the current item. keyK The key of the current item. -
seriesTemplate
-
The
seriesTemplateslot is used to specify the template for generating the series properties of the chart. The slot content must be a single <template> element. The content of the template should only be one <oj-c-area-chart-series> element.See the oj-c-area-chart-series doc for more details.When the template is executed for each series, it will have access to the chart's binding context containing the following properties:
- $current - an object that contains information for the current item. (See the table below for a list of properties available on $current)
- alias - if as attribute was specified, the value will be used to provide an application-named alias for $current.
Properties of $current:
Name Type Description idstring The series id indexnumber The series index itemsArray.<oj-c.AreaChart.ChartItemTemplateContext> The array of objects which are chart items that belong to this series. The objects will have the following properties
Attributes
-
data :(DataProvider.<K, D>|null)
-
Specifies the DataProvider for the sections and items of the area-chart.
Names
Item Name Property dataProperty change event dataChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-data-changed -
drilling :"on"|"off"
-
Whether drilling is enabled. Drillable objects will show a pointer cursor on hover and fire an
ojItemDrill,ojSeriesDrillandojGroupDrillevent on click (double click if selection is enabled). Use "on" to enable drilling for all series objects (legend items), group objects (x-axis labels), and data items. To enable or disable drilling on individual series, group, or data item, use the drilling attribute in each series, group, or data item.- Default Value:
"off"
Supported Values:
Value Description offDrilling is not enabled. onDrilling is enabled on data items, axis labels and legend items. Names
Item Name Property drillingProperty change event drillingChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-drilling-changed -
group-comparator :(context1: oj-c.AreaChart.ChartGroupTemplateContext<K, D>, context2: ChartGroupTemplateContext<K, D>) => number
-
A comparator function that determines the ordering of the chart groups when using a DataProvider. If undefined, the group will follow the order in which they are found in the data. The group objects will have the same properties as the context for groupTemplate's $current. If groupComparator(a, b) is less than 0, chart group a comes before chart group b. If groupComparator(a, b) is 0, the original order is preserved. If groupComparator(a, b) is greater than 0, chart group b comes before chart group a.
Names
Item Name Property groupComparatorProperty change event groupComparatorChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-group-comparator-changed -
hidden-categories :Array<string>
-
- Default Value:
[]
- Supports writeback:
true
Names
Item Name Property hiddenCategoriesProperty change event hiddenCategoriesChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-hidden-categories-changed -
hide-and-show-behavior :"none"|"withoutRescale"|"withRescale"
-
Defines the hide and show behavior that is performed when clicking on a legend item. When data items are hidden, the y axes can be optionally rescaled to fit to the remaining data.
- Default Value:
"none"
Names
Item Name Property hideAndShowBehaviorProperty change event hideAndShowBehaviorChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-hide-and-show-behavior-changed -
highlight-match :"all"|"any"
-
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.
- Default Value:
"any"
Names
Item Name Property highlightMatchProperty change event highlightMatchChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-highlight-match-changed -
highlighted-categories :Array<string>
-
An array of category strings used for highlighting. Series or data items matching categories in this array will be highlighted.
- Default Value:
[]
- Supports writeback:
true
Names
Item Name Property highlightedCategoriesProperty change event highlightedCategoriesChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-highlighted-categories-changed -
hover-behavior :"none"|"dim"
-
Defines the behavior applied when hovering over data items.
- Default Value:
"none"
Names
Item Name Property hoverBehaviorProperty change event hoverBehaviorChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-hover-behavior-changed -
legend :oj-c.AreaChart.ChartLegend
-
An object defining the style, positioning, and behavior of the legend.
Names
Item Name Property legendProperty change event legendChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-legend-changed -
orientation :"horizontal"|"vertical"
-
The orientation of the chart.
- Default Value:
"vertical"
Supported Values:
Value Description horizontalChart will be horizontally oriented. verticalChart will be vertically oriented. Names
Item Name Property orientationProperty change event orientationChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-orientation-changed -
plot-area :oj-c.AreaChart.PlotArea
-
An object defining the style of the plot area.
Names
Item Name Property plotAreaProperty change event plotAreaChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-plot-area-changed -
selection :Array<K>
-
An array containing the ids of the initially selected data items.
- Default Value:
[]
- Supports writeback:
true
Names
Item Name Property selectionProperty change event selectionChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-selection-changed -
selection-mode :"none"|"multiple"|"single"
-
The type of selection behavior that is enabled on the tag cloud. This attribute controls the number of selections that can be made via selection gestures at any given time.
- Default Value:
"none"
Names
Item Name Property selectionModeProperty change event selectionModeChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-selection-mode-changed -
series-comparator :(context1: oj-c.AreaChart.ChartSeriesTemplateContext<K, D>, context2: ChartSeriesTemplateContext<K, D>) => number
-
A comparator function that determines the ordering of the chart series when using a DataProvider. If undefined, the series will follow the order in which they are found in the data. The series objects will have the same properties as the context for seriesTemplate's $current. If seriesComparator(a, b) is less than 0, chart series a comes before chart series b. If seriesComparator(a, b) is 0, the original order is preserved. If seriesComparator(a, b) is greater than 0, chart series b comes before chart series a.
Names
Item Name Property seriesComparatorProperty change event seriesComparatorChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-series-comparator-changed -
stack :"on"|"off"
-
Defines whether the data items are stacked.
- Default Value:
"off"
Supported Values:
Value Description offData items will not be stacked. onData items belonging to same group will be stacked. Names
Item Name Property stackProperty change event stackChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-stack-changed -
value-formats :oj-c.AreaChart.ValueFormats
-
An object specifying value formatting and tooltip behavior, whose keys generally correspond to the attribute names on the data items.
Names
Item Name Property valueFormatsProperty change event valueFormatsChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-value-formats-changed -
x-axis :oj-c.AreaChart.XAxis
-
An object defining properties for the x axis, tick marks, tick labels, and axis titles.
Names
Item Name Property xAxisProperty change event xAxisChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-x-axis-changed -
y-axis :oj-c.AreaChart.YAxis
-
An object defining properties for the y axis, tick marks, tick labels, and axis titles.
Names
Item Name Property yAxisProperty change event yAxisChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-y-axis-changed -
zoom-and-scroll :"off"|"live"
-
Specifies the zoom and scroll behavior of the chart. "Live" behavior means that the chart will be updated continuously as it is being manipulated. While "live" zoom and scroll provides the best end user experience, no guarantess are made about the rendering performance or usability for large data sets or slow client environments.
Names
Item Name Property zoomAndScrollProperty change event zoomAndScrollChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-zoom-and-scroll-changed
Events
-
ojGroupDrill
-
Triggered on a chart group 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. See Events and Listeners for additional information.Name Type Description groupK The group id of the drilled object. groupDataoj-c.AreaChart.Group An array of data for the group the drilled object belongs to. idK The id of the drilled object. itemsArray.<oj-c.AreaChart.AreaItem> An array containing objects describing the data items belonging to the drilled group. -
ojItemDrill
-
Triggered on a chart item (double click if selection is enabled, single click otherwise).
Properties:
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type Description dataoj-c.AreaChart.AreaItem The data object of the drilled item. groupK The group id of the drilled object. groupDataoj-c.AreaChart.Group An array of data for the group the drilled object belongs to. idK The id of the drilled object. itemDataD The row data object of the drilled item. This will only be set if a DataProvider is being used. seriesK The series id of the drilled object. seriesDataoj-c.AreaChart.LineChartSeries The data for the series of the drilled object. -
ojSeriesDrill
-
Triggered on a chart series 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. See Events and Listeners for additional information.Name Type Description idK The id of the drilled object. itemsArray.<oj-c.AreaChart.AreaItem> An array containing objects describing the data items belonging to the drilled group. seriesK The series id of the drilled object. seriesDataoj-c.AreaChart.LineChartSeries The data for the series of the drilled object. -
ojViewportChange
-
Triggered after the viewport is changed due to a zoom or scroll operation.
Properties:
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type Description endGroupstring The end group of the new viewport on a chart with categorical axis. startGroupstring The start group of the new viewport on a chart with categorical axis. xMaxnumber The maximum x value of the new viewport. xMinnumber The minimum x value of the new viewport. yMaxnumber The maximum y value of the new viewport. yMinnumber The minimum y value of the new viewport.
Methods
-
getProperty(property) : {any}
-
Retrieves the value of a property or a subproperty.
Parameters:
Name Type Description propertyThe property name to get. Supports dot notation for subproperty access. Returns:
- Type
- any
-
setProperties(properties) : {void}
-
Performs a batch set of properties.
Parameters:
Name Type Description propertiesAn object containing the property and value pairs to set. Returns:
- Type
- void
-
setProperty(property, value) : {void}
-
Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a corresponding event.
Parameters:
Name Type Description propertyThe property name to set. Supports dot notation for subproperty access. valueThe new value to set the property to. Returns:
- Type
- void
Type Definitions
-
AreaItem<K>
-
Properties:
Name Type Argument Description categoriesArray<string> <optional>
An optional array of category strings corresponding to this data item. This enables highlighting and filtering of individual data items through interactions with the legend or other visualization elements. If not defined, series categories are used. colorstring <optional>
The color of the data item. This color value is not inherited by chart legend. See chart series color and display-in-legend for more details. drilling"inherit" | "off" | "on" <optional>
Whether drilling is enabled for the data item. Drillable objects will show a pointer cursor on hover and fire an ojDrillevent on click (double click if selection is enabled). To enable drilling for all data items at once, use the drilling attribute in the top level.groupIdArray<string> The array of id(s) for the group(s) the item belongs to. For hierarchical groups, it will be an array of outermost to innermost group ids. This is also used to specify the date for non mixed frequency time axes. The specified date for non mixed frequency time axes must be an ISO string. idK The item id should be set by the application if the DataProvider is not being used. The row key will be used as id in the DataProvider case. markerDisplayed"auto" | "off" | "on" <optional>
Defines whether the data marker is displayed. Only applies to line, area, scatter, and bubble series. If auto, the markers will be displayed whenever the data points are not connected by a line. markerShape"auto" | "square" | "circle" | "diamond" | "human" | "plus" | "star" | "triangleDown" | "triangleUp" <optional>
The shape of the data markers. Only applies to line, area, scatter, and bubble series. In addition to the built-in shapes, it may also take SVG path commands to specify a custom shape. The chart will style the custom shapes the same way as built-in shapes, supporting properties like color and borderColor and applying hover and selection effects. Only 'auto' is supported for range series. markerSizenumber <optional>
The size of the data markers. Only applies to line, area, and scatter series. Does not apply to bubble charts, which calculate marker size based on the z values. seriesIdstring The id for the series the item belongs to. shortDescstring <optional>
TThe description of this object. This is used for accessibility and also for customizing the tooltip text. valuenumber The value for this data item. Null can be specified to skip a data point. -
ChartGroupTemplateContext<K,D>
-
Properties:
Name Type Description depthnumber The depth of the group. The depth of the outermost group under the invisible root is 1. idsArray<string> The key of the current item. indexnumber The group index itemsArray<object> The array of objects which are chart items that belong to this series. The objects will have the following properties -
ChartItemTemplateContext<K,D>
-
ChartLegend
-
The chart legend type.
Properties:
Name Type Argument Default Description maxSize(number|string) <optional>
The max size of the legend in pixels or in percentage. position"auto" | "end" | "start" | "top" | "bottom" "auto" The position of the legend within the chart. By default, the legend will be placed on the side or bottom of the chart. rendered"auto" | "off" | "on" "on" Defines whether the legend is rendered. If set to auto, the legend will be hidden for charts with a large bunber of series. size(number|string) <optional>
Defines the size of legend in pixel or percent. symbolHeightnumber <optional>
The height of the legend symbol (line or marker) in pixels. symbolWidthnumber <optional>
The width of the legend symbol (line or marker) in pixels. -
ChartSeriesTemplateContext<K,D>
-
Properties:
Name Type Description idstring The series id indexnumber The series index itemsArray<object> The array of objects which are chart items that belong to this series. The objects will have the following properties -
Group
-
Properties:
Name Type Argument Description accessibleLabelstring <optional>
The description of the group. This is used for the customizing the tooltip text and only applies to a categorical axis. drilling"inherit" | "off" | "on" <optional>
Whether drilling is enabled in the group label. idstring The id of the group. namestring <optional>
The name of the group. -
LineChartSeries<K>
-
Properties:
Name Type Argument Description categoriesArray<string> <optional>
An array of category strings corresponding to the tag cloud items. This allows highlighting and filtering of items. colorstring <optional>
The color of the series. The chart legend item will inherit this color value. drilling"inherit" | "off" | "on" <optional>
Whether drilling is enabled on the series item. Drillable objects will show a pointer cursor on hover and fire an ojDrillevent on click (double click if selection is enabled). To enable drilling for all series items at once, use the drilling attribute in the top level.itemsArray<object> lineType"curved" | "straight" <optional>
The line type of the data line or area. Only applies to line, area, scatter, and bubble series. centeredStepped and centeredSegmented are not supported for polar, scatter, and bubble charts. markerColorstring <optional>
The color of the data markers, if different from the series color. markerDisplayedstring <optional>
Defines whether the data marker is displayed. Only applies to line, area, scatter, and bubble series. If auto, the markers will be displayed whenever the data points are not connected by a line. markerShape"auto" | "square" | "circle" | "diamond" | "human" | "plus" | "star" | "triangleDown" | "triangleUp" <optional>
The shape of the data markers. In addition to the built-in shapes, it may also take SVG path commands to specify a custom shape. The chart will style the custom shapes the same way as built-in shapes, supporting properties like color and borderColor and applying hover and selection effects. Only 'auto' is supported for range series. markerSizenumber <optional>
The size of the data markers. namestring <optional>
The name of the series, displayed in the legend and tooltips. shortDescstring <optional>
The description of this series. This is used for accessibility and for customizing the tooltip text on the corresponding legend item for the series. -
PlotArea
-
Properties:
Name Type Argument Description backgroundColorstring <optional>
The color of the plot area background. -
ValueFormats
-
Properties:
Name Type Description groupobject Object that specifies the value formatting and tooltip behavior for the group. seriesobject Object that specifies the value formatting and tooltip behavior for the series. valueobject Object that specifies the value formatting and tooltip behavior for the item value. -
XAxis
-
Properties:
Name Type Argument majorTickobject <optional>
-
YAxis
-
Properties:
Name Type Argument majorTickobject <optional>
minorTickobject <optional>