import { ModelWithMultiAxes } from "@arcgis/charts-components/model/mixins/model-with-multi-axes.js";- Inheritance:
- ModelWithMultiAxes→
chart-model→ chart-model-base→ EventTarget
- Subclasses:
- serial-chart-model, box-plot-model, histogram-model, scatterplot-model
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| args | any[] | | |
Properties
| Property | Type | Class |
|---|---|---|
asyncUpdatesPromise inherited | ||
backgroundColor inherited | ||
chartId inherited | ||
chartRenderer inherited | IDrawingInfo["renderer"] | undefined | |
chartSubtitleVisibility inherited | ||
chartSubType readonly inherited | ||
chartTitleVisibility inherited | ||
chartType readonly inherited | ||
config inherited | ||
| | ||
| | ||
| | ||
| | ||
dataStore inherited | ||
descriptionSymbol inherited | ||
descriptionText inherited | ||
descriptionVisibility inherited | ||
fetchNULLValues inherited | ||
layer readonly inherited | ||
seriesLength readonly inherited | ||
splitByValues readonly inherited | string[] | |
subtitleSymbol inherited | ||
subtitleText inherited | ||
titleSymbol inherited | ||
titleText inherited | ||
version readonly inherited |
asyncUpdatesPromise
Promise that resolves when the setup process is complete.
Note: This promise does not need to be awaited if the setup method has already been awaited. It is simply provided as a way to await the setup process from other functions if needed to avoid race conditions.
backgroundColor
The background color of the chart.
chartRenderer
- Type
- IDrawingInfo["renderer"] | undefined
The chart renderer.
Example
In this example, we set the chartRenderer for a class-break heat chart.
heatChartModel.chartRenderer = { "type": "classBreaks", "field": "arcgis_charts_heat_chart_value", "classBreakInfos": [ { "label": "70 - 145", "classMinValue": 70, "classMaxValue": 145, "symbol": { "type": "esriSFS", "color": [ 212, 227, 255, 255 ], "style": "esriSFSSolid" } }, { "label": "146 - 250", "classMinValue": 146, "classMaxValue": 250, "symbol": { "type": "esriSFS", "color": [ 43, 108, 240, 255 ], "style": "esriSFSSolid" } } ] }; chartSubtitleVisibility
- Type
- boolean
Whether or not the chart subtitle is visible.
Note: Even if the subtitle is visible, it may not be displayed if the subtitle text is empty.
chartSubType
- Type
- ChartSubType
The chart sub type of the series.
chartTitleVisibility
- Type
- boolean
Whether or not the chart title is visible.
Note: Even if the title is visible, it may not be displayed if the title text is empty.
config
- Type
- ChartConfig
The current chart configuration object.
cursorCrosshair
- Type
- WebChartCursorCrosshair | undefined
Cursor crosshair from the chart config.
Note: To set the cursor crosshair for the second Y-axis (axisIndex 2), ensure there is a second Y-axis in the chart by using the setAssignToSecondValueAxis(true, 1) method to assign a series to the second Y-axis.
cursorCrosshairHorizontalLineVisibility
- Type
- boolean
Visibility of the horizontal line of the cursor's crosshair.
- If the cursor crosshair or its horizontal line visibility is not set, the default value of
falsewill be returned.
Note: To set the cursor crosshair horizontal line visibility for the second Y-axis (axisIndex 2), ensure there is a second Y-axis in the chart by using the setAssignToSecondValueAxis(true, 1) method to assign a series to the second Y-axis.
cursorCrosshairStyle
- Type
- ISimpleLineSymbol | undefined
Style of the cursor's crosshair from the chart config.
Note: To set the cursor crosshair style for the second Y-axis (axisIndex 2), ensure there is a second Y-axis in the chart by using the setAssignToSecondValueAxis(true, 1) method to assign a series to the second Y-axis.
cursorCrosshairVerticalLineVisibility
- Type
- boolean
Visibility of the vertical line of the cursor's crosshair.
- If the cursor crosshair or its vertical line visibility is not set, the default value of
falsewill be returned.
Note: To set the cursor crosshair vertical line visibility for the second Y-axis (axisIndex 2), ensure there is a second Y-axis in the chart by using the setAssignToSecondValueAxis(true, 1) method to assign a series to the second Y-axis.
dataStore
- Type
- any
Data store object that can be used to store any data needed for the chart.
descriptionSymbol
- Type
- WebChartTextSymbol | undefined
The description text symbol. Contains styling information such as font, color, and symbol style.
descriptionVisibility
- Type
- boolean
Whether or not the chart description is visible.
Note: Even if the description is visible, it may not be displayed if the description text is empty.
fetchNULLValues
- Type
- boolean
Whether to fetch null values for them to be counted or displayed as categories on the chart.
layer
- Type
- SupportedLayer | undefined
The chart model's layer.
seriesLength
- Type
- number
The length of the series array.
splitByValues
- Type
- string[]
The split-by values for the chart.
subtitleSymbol
- Type
- WebChartTextSymbol | undefined
The subtitle text symbol. Contains styling information such as font, color, and symbol style.
subtitleText
- Type
- string
The chart subtitle text.
titleSymbol
- Type
- WebChartTextSymbol | undefined
The title text symbol. Contains styling information such as font, color, and symbol style.
version
The version of the chart configuration.
Methods
| Method | Signature | Class |
|---|---|---|
generateChartTitle inherited | generateChartTitle(): string | |
generateYAxisTitle(): string | | |
getAxisLabelsVisibility(axisIndex: number): boolean | | |
getAxisScrollbar(axisIndex: number): WebChartAxisScrollBar | undefined | | |
getAxisTitleSymbol(axisIndex: number): WebChartTextSymbol | undefined | | |
getAxisTitleText(axisIndex: number): string | | |
getAxisTitleVisibility(axisIndex: number): boolean | | |
getAxisValueFormat(axisIndex: number): CategoryFormatOptions | DateTimeFormatOptions | NumberFormatOptions | undefined | | |
getAxisVisibility(axisIndex: number): boolean | | |
getBuffer(axisIndex: number): boolean | | |
getDataFilters inherited | getDataFilters(): WebChartDataFilters | undefined | |
getDataTooltipValueFormat inherited | getDataTooltipValueFormat(seriesIndex: number): NumberFormatOptions | undefined | |
getDefaultXAxisTitleText(): string | | |
getDisplayCursorTooltip(axisIndex: number): boolean | | |
getDisplayZeroLine(axisIndex: number): boolean | | |
getGridLinesSymbol(): ISimpleLineSymbol | undefined | | |
getHorizontalAxisLabelsBehavior(): WebChartLabelBehavior | | |
getIntegerOnlyValues(axisIndex: number): boolean | | |
getLogarithmic(axisIndex: number): boolean | | |
getMaxBound(axisIndex: number): number | | |
getMinBound(axisIndex: number): number | | |
getSeriesId inherited | getSeriesId(seriesIndex: number): string | undefined | |
getSeriesIndex inherited | getSeriesIndex(seriesId: string): number | undefined | |
getSeriesVisibility inherited | getSeriesVisibility(seriesIndex: number): boolean | |
getTickSpacing(axisIndex: number): number | undefined | | |
getVerticalAxisLabelsBehavior(): WebChartLabelBehavior | | |
isSameChartAs inherited | isSameChartAs(otherModel: ChartModel | undefined): boolean | |
setAxisLabelsVisibility(isVisible: boolean, axisIndex: number): void | | |
setAxisScrollbar(scrollbar: WebChartAxisScrollBar, axisIndex: number): void | | |
setAxisTitleSymbol(titleSymbol: WebChartTextSymbol | undefined, axisIndex: number): void | | |
setAxisTitleText(titleText: string, axisIndex: number): void | | |
setAxisTitleVisibility(isVisible: boolean, axisIndex: number): void | | |
setAxisValueFormat(axisIndex: number, valueFormat?: CategoryFormatOptions | DateTimeFormatOptions | NumberFormatOptions): void | | |
setAxisVisibility(isVisible: boolean, axisIndex: number): void | | |
setBuffer(buffer: boolean, axisIndex: number): void | | |
setDataFilters inherited | setDataFilters(newDataFilters: WebChartDataFilters | undefined): Promise<void> | |
setDataTooltipValueFormat inherited | setDataTooltipValueFormat(seriesIndex: number, valueFormat: NumberFormatOptions | undefined): void | |
setDisplayCursorTooltip(displayCursorTooltip: boolean, axisIndex: number): void | | |
setDisplayZeroLine(displayZeroLine: boolean, axisIndex: number): void | | |
setGridLinesSymbol(linesSymbol: ISimpleLineSymbol | undefined, axisIndices?: number[]): void | | |
setHorizontalAxisLabelsBehavior(horizontalBehavior: WebChartLabelBehavior): void | | |
setIntegerOnlyValues(integerOnlyValues: boolean, axisIndex: number): void | | |
setLogarithmic(isLogarithmic: boolean, axisIndex: number): void | | |
setMaxBound(newMaxBound: number | null, axisIndex: number): void | | |
setMinBound(newMinBound: number | null, axisIndex: number): void | | |
setSeriesVisibility inherited | setSeriesVisibility(props: LegendItemVisibility): void | |
setTickSpacing(tickSpacing: number, axisIndex: number): void | | |
setup inherited | setup(params: ModelParams<ChartConfig>): Promise<void> | |
setVerticalAxisLabelsBehavior(verticalBehavior: WebChartLabelBehavior): void | | |
update inherited | update(): Promise<void> |
generateChartTitle
- Signature
-
generateChartTitle (): string
Generate the proper chart title from the current config.
- Returns
- string
generateYAxisTitle
- Signature
-
generateYAxisTitle (): string
Generate the proper y-axis title from the current config.
- Returns
- string
getAxisScrollbar
- Signature
-
getAxisScrollbar (axisIndex: number): WebChartAxisScrollBar | undefined
Gets the scrollbar configuration for the specified axis.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| axisIndex | The index of the axis (0 for X-axis, 1 for Y-axis, 2 for second Y-axis). | |
- Returns
- WebChartAxisScrollBar | undefined
getAxisTitleSymbol
- Signature
-
getAxisTitleSymbol (axisIndex: number): WebChartTextSymbol | undefined
Gets the specified title text symbol. Contains styling information such as font, color, and symbol style.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| axisIndex | The index of the axis to get the title symbol for | |
- Returns
- WebChartTextSymbol | undefined
getAxisValueFormat
- Signature
-
getAxisValueFormat (axisIndex: number): CategoryFormatOptions | DateTimeFormatOptions | NumberFormatOptions | undefined
Gets the value format for the specified axis.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| axisIndex | The index of the axis (0 for X-axis, 1 for Y-axis, 2 for second Y-axis). | |
getBuffer
- Signature
-
getBuffer (axisIndex: number): boolean
Gets the buffer setting for the specified axis.
- This setting is only applicable to the axis of type ValueAxis.
- To get the setting for the x-axis, the axisIndex should be
0. For the y-axis, the axisIndex should be1. - If the
bufferis not set on the axis, the default value offalsewill be returned.
getDataFilters
- Signature
-
getDataFilters (): WebChartDataFilters | undefined
Gets the data filter for the bar chart.
- Returns
- WebChartDataFilters | undefined
getDataTooltipValueFormat
- Signature
-
getDataTooltipValueFormat (seriesIndex: number): NumberFormatOptions | undefined
Gets the data tooltip value format for a series.
If the series index is out of bounds or the series list is empty, this function will return undefined.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| seriesIndex | The index of the series to retrieve the value format for. | |
- Returns
- NumberFormatOptions | undefined
getDefaultXAxisTitleText
- Signature
-
getDefaultXAxisTitleText (): string
Get the default x-axis title text.
- Returns
- string
getDisplayCursorTooltip
- Signature
-
getDisplayCursorTooltip (axisIndex: number): boolean
Gets the display cursor tooltip setting for the specified axis.
- To get the setting for the x-axis, the axisIndex should be
0. For the y-axis, the axisIndex should be1. - If the displayCursorTooltip is not set on the axis, the default value of
falsewill be returned.
getDisplayZeroLine
- Signature
-
getDisplayZeroLine (axisIndex: number): boolean
Gets the display zero line setting for the specified axis.
- This setting is only applicable to the axis of type ValueAxis.
- To get the setting for the x-axis, the axisIndex should be
0. For the y-axis, the axisIndex should be1. - If the displayZeroLine is not set on the axis, the default value of
falsewill be returned.
getGridLinesSymbol
- Signature
-
getGridLinesSymbol (): ISimpleLineSymbol | undefined
Gets the grid lines symbol. Contains styling information such as line width, line style, and line color.
- Returns
- ISimpleLineSymbol | undefined
getHorizontalAxisLabelsBehavior
- Signature
-
getHorizontalAxisLabelsBehavior (): WebChartLabelBehavior
Gets the horizontal axis labels behavior for the chart.
- Returns
- WebChartLabelBehavior
getIntegerOnlyValues
- Signature
-
getIntegerOnlyValues (axisIndex: number): boolean
Gets the integer only values setting for the specified axis.
- This setting is only applicable to the axis of type ValueAxis.
- To get the setting for the x-axis, the axisIndex should be
0. For the y-axis, the axisIndex should be1. - If the
integerOnlyValuesis not set on the axis, the default value offalsewill be returned.
getSeriesId
- Signature
-
getSeriesId (seriesIndex: number): string | undefined
Gets the series ID for a given series index.
If the series index is out of bounds, this function will return undefined.
getSeriesIndex
- Signature
-
getSeriesIndex (seriesId: string): number | undefined
Gets the series index for a given series ID.
If the series ID is not found, this function will return undefined.
getSeriesVisibility
- Signature
-
getSeriesVisibility (seriesIndex: number): boolean
Gets the visibility of a series.
getVerticalAxisLabelsBehavior
- Signature
-
getVerticalAxisLabelsBehavior (): WebChartLabelBehavior
Gets the vertical axis labels behavior for the chart.
- Returns
- WebChartLabelBehavior
isSameChartAs
- Signature
-
isSameChartAs (otherModel: ChartModel | undefined): boolean
Checks if the current chart model is for the same chart as another chart model.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| otherModel | The other chart model to compare to. | |
- Returns
- boolean
setAxisLabelsVisibility
- Signature
-
setAxisLabelsVisibility (isVisible: boolean, axisIndex: number): void
Sets the visibility of the specified axis labels.
Note: The labels visibility for the second Y-axis (axisIndex 2) will only be applied if there is a second Y-axis in the chart. To enable the second Y-axis, use the setAssignToSecondValueAxis(true, 1) method to assign a series to the second Y-axis.
setAxisScrollbar
- Signature
-
setAxisScrollbar (scrollbar: WebChartAxisScrollBar, axisIndex: number): void
Sets the scrollbar configuration for the specified axis.
Note: The scrollbar configuration for the second Y-axis (axisIndex 2) will only be applied if there is a second Y-axis in the chart. To enable the second Y-axis, use the setAssignToSecondValueAxis(true, 1) method to assign a series to the second Y-axis.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| scrollbar | The scrollbar configuration to set. | | |
| axisIndex | The index of the axis (0 for X-axis, 1 for Y-axis, 2 for second Y-axis). | |
- Returns
- void
setAxisTitleSymbol
- Signature
-
setAxisTitleSymbol (titleSymbol: WebChartTextSymbol | undefined, axisIndex: number): void
Sets the title text symbol for the specified axis. Contains styling information such as font, color, and symbol style.
Note: The title text symbol for the second Y-axis (axisIndex 2) will only be applied if there is a second Y-axis in the chart. To enable the second Y-axis, use the setAssignToSecondValueAxis(true, 1) method to assign a series to the second Y-axis.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| titleSymbol | The title text symbol to set. | | |
| axisIndex | The index of the axis (0 for X-axis, 1 for Y-axis, 2 for second Y-axis). | |
- Returns
- void
setAxisTitleText
- Signature
-
setAxisTitleText (titleText: string, axisIndex: number): void
Sets the title text for the specified axis.
Note: The title text for the second Y-axis (axisIndex 2) will only be applied if there is a second Y-axis in the chart. To enable the second Y-axis, use the setAssignToSecondValueAxis(true, 1) method to assign a series to the second Y-axis.
setAxisTitleVisibility
- Signature
-
setAxisTitleVisibility (isVisible: boolean, axisIndex: number): void
Sets the visibility of the specified axis title.
Note: The title visibility for the second Y-axis (axisIndex 2) will only be applied if there is a second Y-axis in the chart. To enable the second Y-axis, use the setAssignToSecondValueAxis(true, 1) method to assign a series to the second Y-axis.
setAxisValueFormat
- Signature
-
setAxisValueFormat (axisIndex: number, valueFormat?: CategoryFormatOptions | DateTimeFormatOptions | NumberFormatOptions): void
Sets the value format for the specified axis.
Note: The value format for the second Y-axis (axisIndex 2) will only be applied if there is a second Y-axis in the chart. To enable the second Y-axis, use the setAssignToSecondValueAxis(true, 1) method to assign a series to the second Y-axis.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| axisIndex | The index of the axis (0 for X-axis, 1 for Y-axis, 2 for second Y-axis). | | |
| valueFormat | The value format to set. | |
- Returns
- void
setAxisVisibility
- Signature
-
setAxisVisibility (isVisible: boolean, axisIndex: number): void
Sets the visibility of the specified axis.
Note: The visibility for the second Y-axis (axisIndex 2) will only be applied if there is a second Y-axis in the chart. To enable the second Y-axis, use the setAssignToSecondValueAxis(true, 1) method to assign a series to the second Y-axis.
setBuffer
- Signature
-
setBuffer (buffer: boolean, axisIndex: number): void
Sets the buffer for the specified axis.
- This setting is only applicable to the axis of type ValueAxis.
- To set the setting for the x-axis, the axisIndex should be
0. For the y-axis, the axisIndex should be1.
Note: To set the buffer for the second Y-axis (axisIndex 2), ensure there is a second Y-axis in the chart by using the setAssignToSecondValueAxis(true, 1) method to assign a series to the second Y-axis.
setDataFilters
- Signature
-
setDataFilters (newDataFilters: WebChartDataFilters | undefined): Promise<void>
Sets the data filter for the chart.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| newDataFilters | The new data filter. | |
setDataTooltipValueFormat
- Signature
-
setDataTooltipValueFormat (seriesIndex: number, valueFormat: NumberFormatOptions | undefined): void
Sets the data tooltip value format for a series.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| seriesIndex | The index of the series to set the value format for. | | |
| valueFormat | The value format to set. | |
- Returns
- void
setDisplayCursorTooltip
- Signature
-
setDisplayCursorTooltip (displayCursorTooltip: boolean, axisIndex: number): void
Sets the display cursor tooltip setting for the specified axis.
- To set the setting for the x-axis, the axisIndex should be
0. For the y-axis, the axisIndex should be1.
Note: To set the display cursor tooltip for the second Y-axis (axisIndex 2), ensure there is a second Y-axis in the chart by using the setAssignToSecondValueAxis(true, 1) method to assign a series to the second Y-axis.
setDisplayZeroLine
- Signature
-
setDisplayZeroLine (displayZeroLine: boolean, axisIndex: number): void
Sets the display zero line setting for the specified axis.
- This setting is only applicable to the axis of type ValueAxis.
- To set the setting for the x-axis, the axisIndex should be
0. For the y-axis, the axisIndex should be1.
Note: To set the display zero line for the second Y-axis (axisIndex 2), ensure there is a second Y-axis in the chart by using the setAssignToSecondValueAxis(true, 1) method to assign a series to the second Y-axis.
setGridLinesSymbol
- Signature
-
setGridLinesSymbol (linesSymbol: ISimpleLineSymbol | undefined, axisIndices?: number[]): void
Sets the grid lines symbol. Contains styling information such as line width, line style, and line color.
Note: To set the grid lines symbol for the second Y-axis (axisIndex 2), ensure there is a second Y-axis in the chart by using the setAssignToSecondValueAxis(true, 1) method to assign a series to the second Y-axis.
setHorizontalAxisLabelsBehavior
- Signature
-
setHorizontalAxisLabelsBehavior (horizontalBehavior: WebChartLabelBehavior): void
Sets the horizontal axis labels behavior for the chart.
Note: The horizontal axis labels behavior for the second Y-axis (axisIndex 2) will only be applied if there is a second Y-axis in the chart. To enable the second Y-axis, use the setAssignToSecondValueAxis(true, 1) method to assign a series to the second Y-axis.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| horizontalBehavior | The behavior for the horizontal axis labels. | |
- Returns
- void
setIntegerOnlyValues
- Signature
-
setIntegerOnlyValues (integerOnlyValues: boolean, axisIndex: number): void
Sets the integer only values setting for the specified axis.
- This setting is only applicable to the axis of type ValueAxis.
- To set the setting for the x-axis, the axisIndex should be
0. For the y-axis, the axisIndex should be1.
Note: To set the integer only values for the second Y-axis (axisIndex 2), ensure there is a second Y-axis in the chart by using the setAssignToSecondValueAxis(true, 1) method to assign a series to the second Y-axis.
setLogarithmic
- Signature
-
setLogarithmic (isLogarithmic: boolean, axisIndex: number): void
Sets whether logarithmic scale is enabled for the specified axis.
true: Enable logarithmic scale for the specified axis.false: Disable logarithmic scale for the specified axis.
Note: The logarithmic scale for the second Y-axis (axisIndex 2) will only be applied if there is a second Y-axis in the chart. To enable the second Y-axis, use the setAssignToSecondValueAxis(true, 1) method to assign a series to the second Y-axis.
setMaxBound
- Signature
-
setMaxBound (newMaxBound: number | null, axisIndex: number): void
Sets the maximum bound for the specified axis.
Note: The maximum bound for the second Y-axis (axisIndex 2) will only be applied if there is a second Y-axis in the chart. To enable the second Y-axis, use the setAssignToSecondValueAxis(true, 1) method to assign a series to the second Y-axis.
setMinBound
- Signature
-
setMinBound (newMinBound: number | null, axisIndex: number): void
Sets the minimum bound for the specified axis.
Note: The minimum bound for the second Y-axis (axisIndex 2) will only be applied if there is a second Y-axis in the chart. To enable the second Y-axis, use the setAssignToSecondValueAxis(true, 1) method to assign a series to the second Y-axis.
setSeriesVisibility
- Signature
-
setSeriesVisibility (props: LegendItemVisibility): void
Sets the visibility of a series.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| props | Visibility options for the series. | |
- Returns
- void
setTickSpacing
- Signature
-
setTickSpacing (tickSpacing: number, axisIndex: number): void
Sets the tick spacing for the specified axis.
- To set the setting for the x-axis, the axisIndex should be
0. For the y-axis, the axisIndex should be1. Note: To set the tick spacing for the second Y-axis (axisIndex 2), ensure there is a second Y-axis in the chart by using thesetAssignToSecondValueAxis(true, 1)method to assign a series to the second Y-axis.
setup
- Signature
-
setup (params: ModelParams<ChartConfig>): Promise<void>
Completes the async setup process for the chart model. Must be called before using the model.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| params | The parameters to be used to set up the chart model. | |
setVerticalAxisLabelsBehavior
- Signature
-
setVerticalAxisLabelsBehavior (verticalBehavior: WebChartLabelBehavior): void
Sets the vertical axis labels behavior for the chart.
Note: The vertical axis labels behavior for the second Y-axis (axisIndex 2) will only be applied if there is a second Y-axis in the chart. To enable the second Y-axis, use the setAssignToSecondValueAxis(true, 1) method to assign a series to the second Y-axis.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| verticalBehavior | The behavior for the vertical axis labels. | |
- Returns
- void
update
- Signature
-
update (): Promise<void>
Can be awaited to allow any pending async updates to complete.