import { WithChartRenderer } from "@arcgis/charts-components/model/properties/chart-renderer.js";- Inheritance:
- WithChartRenderer→
chart-model-base→ EventTarget
- Subclasses:
- chart-model
Adds support for working with chart renderer.
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| args | any[] | | |
Properties
| Property | Type | Class |
|---|---|---|
asyncUpdatesPromise inherited | ||
IDrawingInfo["renderer"] | undefined | | |
chartType readonly inherited | ||
dataStore 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.
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" } } ] }; dataStore
- Type
- any
Data store object that can be used to store any data needed for the chart.
Methods
| Method | Signature | Class |
|---|---|---|
generateChartTitle inherited | generateChartTitle(): string | |
isSameChartAs inherited | isSameChartAs(otherModel: ChartModel | undefined): boolean | |
setup inherited | setup(params: ModelParams<ChartConfig>): Promise<void> | |
update inherited | update(): Promise<void> |
generateChartTitle
- Signature
-
generateChartTitle (): string
Generate the proper chart title from the current config.
- Returns
- string
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
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. | |
update
- Signature
-
update (): Promise<void>
Can be awaited to allow any pending async updates to complete.