▾
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 |
|---|---|---|
| inherited | ||
| inherited | ||
| inherited | ||
| inherited | IDrawingInfo["renderer"] | undefined | |
| inherited | ||
| readonly inherited | ||
| inherited | ||
| readonly inherited | ||
| inherited | ||
| | ||
| | ||
| | ||
| | ||
| inherited | ||
| inherited | ||
| inherited | ||
| inherited | ||
| inherited | ||
| readonly inherited | ||
| readonly inherited | ||
| readonly inherited | ||
| readonly inherited | string[] | |
| inherited | ||
| inherited | ||
| inherited | ||
| inherited | ||
| 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.
cursorCrosshairHorizontalLineVisibility
- Type
- boolean
Gets the 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.
cursorCrosshairStyle
- Type
- ISimpleLineSymbol | undefined
Gets the style of the cursor's crosshair.
cursorCrosshairVerticalLineVisibility
- Type
- boolean
Gets the 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.
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 | SupportedRasterLayer | undefined
The chart model's layer.
revision
- Type
- number
The current revision number of the chart configuration. Increments with each update.
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 |
|---|---|---|
| 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 | | |
| inherited | getDataFilters(): WebChartDataFilters | undefined | |
| inherited | getDataTooltipFontSize(seriesIndex: number): number | undefined | |
| 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 | | |
| inherited | getSeriesId(seriesIndex: number): string | undefined | |
| inherited | getSeriesIndex(seriesId: string): number | undefined | |
| inherited | getSeriesVisibility(seriesIndex: number): boolean | |
| getTickSpacing(axisIndex: number): number | undefined | | |
| getVerticalAxisLabelsBehavior(): WebChartLabelBehavior | | |
| inherited | isSameChartAs(otherModel: ChartModel | undefined): boolean | |
| inherited | recall(configRevision?: number): ChartConfig | undefined | |
| 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 | | |
| inherited | setDataFilters(newDataFilters: WebChartDataFilters | undefined): Promise<void> | |
| inherited | setDataTooltipFontSize(fontSize: number | undefined, seriesIndex: number): void | |
| 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 | | |
| inherited | setSeriesVisibility(props: LegendItemVisibility): void | |
| setTickSpacing(tickSpacing: number, axisIndex: number): void | | |
| inherited | setup(params: ModelParams<ChartConfig>): Promise<void> | |
| setVerticalAxisLabelsBehavior(verticalBehavior: WebChartLabelBehavior): void | | |
| 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 | Axis index for the chart: | |
- 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 | Axis index for the chart: | |
getDataFilters
- Signature
-
getDataFilters (): WebChartDataFilters | undefined
Gets the data filter for the chart.
- Returns
- WebChartDataFilters | undefined
getDataTooltipFontSize
- Signature
-
getDataTooltipFontSize (seriesIndex: number): number | undefined
Gets the data tooltip font size for a series.
If the series index is out of bounds or the series list is empty, this function will return 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
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. - 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
recall
- Signature
-
recall (configRevision?: number): ChartConfig | undefined
Recalls a previous chart configuration based on its revision number. Returns undefined if the requested revision is not available (beyond the stored history limit).
If no configRevision number is provided, it recalls the last configuration just before the current one.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| configRevision | | |
- Returns
- ChartConfig | undefined
setAxisScrollbar
- Signature
-
setAxisScrollbar (scrollbar: WebChartAxisScrollBar, axisIndex: number): void
Sets the scrollbar configuration for zooming and panning along the specified axis.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| scrollbar | The scrollbar configuration to set. | | |
| axisIndex | Axis index for the chart: | |
- Returns
- void
- Example
- // Sets the scrollbar for the x-axischartModel.setAxisScrollbar({visible: true,width: 20,color: [70, 174, 211, 255],gripSize: 32,margin: 8,},0,);// Sets the scrollbar for the y-axischartModel.setAxisScrollbar({visible: true,width: 20,color: [158, 194, 49, 255],gripSize: 32,margin: 8,},1,);
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.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| titleSymbol | The title text symbol to set. | | |
| axisIndex | Axis index for the chart: | |
- Returns
- void
setAxisValueFormat
- Signature
-
setAxisValueFormat (axisIndex: number, valueFormat?: CategoryFormatOptions | DateTimeFormatOptions | NumberFormatOptions): void
Sets the value format for the specified axis.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| axisIndex | Axis index for the chart: | | |
| valueFormat | The value format to set. | |
- Returns
- void
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. | |
setDataTooltipFontSize
- Signature
-
setDataTooltipFontSize (fontSize: number | undefined, seriesIndex: number): void
Sets the data tooltip font size for a series.
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
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.
- See also
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| linesSymbol | The grid lines symbol. | | |
| axisIndices | number[] | The indices of the axes to set the grid lines symbol for. If omitted, the symbol is applied to all axes. | |
- Returns
- void
- Example
- // Set the grid lines symbol for all axes since `axisIndices` is omittedchartModel.setGridLinesSymbol({type: "esriSLS",style: "esriSLSDashDot",color: [0, 0, 128, 255],width: 3,});

setHorizontalAxisLabelsBehavior
- Signature
-
setHorizontalAxisLabelsBehavior (horizontalBehavior: WebChartLabelBehavior): void
Sets the horizontal axis labels behavior for the chart.
- Default behavior is
rotate, except for histogram where the default ishide.
hide | rotate | stagger | wrap |
|---|---|---|---|
![]() | ![]() | ![]() | ![]() |
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.
Parameters
- Returns
- void
setLogarithmic
- Signature
-
setLogarithmic (isLogarithmic: boolean, axisIndex: number): void
Sets whether logarithmic scale is enabled for the specified axis.
X-axis (axisIndex: 0) | Primary y-axis (axisIndex: 1) | Both axes |
|---|---|---|
![]() | ![]() | ![]() |
Parameters
- Returns
- void
- Example
- // Apply a logarithmic scale to the x-axis (index 0) and primary y-axis (index 1)chartModel.setLogarithmic(true, 0);chartModel.setLogarithmic(true, 1);
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
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.
hide | wrap |
|---|---|
![]() | ![]() |
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.










