ESM
import { ChartModelBase } from "@arcgis/charts-components/model/chart-model/chart-model-base.js";
Inheritance
ChartModelBase→EventTarget
Subclasses
rounded-corners, config, layer, chart-id, title-text, title-symbol, version, subtitle-text, subtitle-symbol, description-text, description-symbol, title-visibility, subtitle-visibility, description-visibility, chart-renderer, background-color, series-visibility, series-id, series-index, series-length, chart-sub-type, data-tooltip-value-format, data-tooltip-font-size, fetch-null-values, split-by-values, data-filters, chart-model, color-match, rotated-state, data-labels-visibility, data-labels-symbol, x-axis-title-text, x-axis-labels-visibility, x-axis-title-visibility, max-x-bound, min-x-bound, x-bounds, x-axis-title-symbol, axis-labels-symbol, axis-lines-symbol, generate-x-axis-title, time-zone, negative-values-stacked-to-baseline

Constructors

Constructor

Constructor

Parameters

ParameterTypeDescriptionRequired
args
any[]

Properties

asyncUpdatesPromise

Property
Type
Promise<void>

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.

chartType

readonly Property
Type
ChartTypes

The chart type.

dataStore

Property
Type
any

Data store object that can be used to store any data needed for the chart.

revision

readonly Property
Type
number

The current revision number of the chart configuration. Increments with each update.

Methods

MethodSignatureClass
generateChartTitle(): string
isSameChartAs(otherModel: ChartModel | undefined): boolean
recall(configRevision?: number): ChartConfig | undefined
setup(params: ModelParams<ChartConfig>): Promise<void>
update(): Promise<void>

generateChartTitle

Method
Signature
generateChartTitle (): string

Generate the proper chart title from the current config.

Returns
string

isSameChartAs

Method
Signature
isSameChartAs (otherModel: ChartModel | undefined): boolean

Checks if the current chart model is for the same chart as another chart model.

Parameters

ParameterTypeDescriptionRequired
otherModel

The other chart model to compare to.

Returns
boolean

recall

Method
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

ParameterTypeDescriptionRequired
configRevision
Returns
ChartConfig | undefined

setup

Method
Signature
setup (params: ModelParams<ChartConfig>): Promise<void>

Completes the async setup process for the chart model. Must be called before using the model.

Parameters

ParameterTypeDescriptionRequired
params

The parameters to be used to set up the chart model.

Returns
Promise<void>

update

Method
Signature
update (): Promise<void>

Can be awaited to allow any pending async updates to complete.

Returns
Promise<void>