import { ModelWithXGuides } from "@arcgis/charts-components/model/mixins/model-with-x-guides.js";- Inheritance:
- ModelWithXGuides→
model-with-guides→ chart-model→ chart-model-base→ EventTarget
- Subclasses:
- serial-chart-model, gauge-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 | ||
guideLabelsSymbol 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.
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.
guideLabelsSymbol
- Type
- WebChartTextSymbol | undefined
The guide labels text symbol (font, color, style).
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 |
|---|---|---|
addXAxisGuide(name: string, index?: number): void | | |
deleteXAxisGuide(index?: number): void | | |
generateChartTitle inherited | generateChartTitle(): string | |
getDataFilters inherited | getDataFilters(): WebChartDataFilters | undefined | |
getDataTooltipValueFormat inherited | getDataTooltipValueFormat(seriesIndex: number): NumberFormatOptions | undefined | |
getGuideAbove inherited | getGuideAbove(index?: number, orientation?: GuideOrientation): boolean | |
getGuideEnd inherited | getGuideEnd(index?: number, orientation?: GuideOrientation): Date | number | string | null | undefined | |
getGuideLabelText inherited | getGuideLabelText(index?: number, orientation?: GuideOrientation): string | undefined | |
getGuideName inherited | getGuideName(index?: number, orientation?: GuideOrientation): string | undefined | |
getGuideStart inherited | getGuideStart(index?: number, orientation?: GuideOrientation): Date | number | string | null | |
getGuideStyle inherited | getGuideStyle(index?: number, orientation?: GuideOrientation): ISimpleFillSymbol | ISimpleLineSymbol | undefined | |
getGuideVisibility inherited | getGuideVisibility(index?: number, orientation?: GuideOrientation): boolean | |
getSeriesId inherited | getSeriesId(seriesIndex: number): string | undefined | |
getSeriesIndex inherited | getSeriesIndex(seriesId: string): number | undefined | |
getSeriesVisibility inherited | getSeriesVisibility(seriesIndex: number): boolean | |
getTooltipReverseColor inherited | getTooltipReverseColor(index: number, orientation?: GuideOrientation): boolean | |
getXGuidesLength(): number | undefined | | |
isSameChartAs inherited | isSameChartAs(otherModel: ChartModel | undefined): boolean | |
setDataFilters inherited | setDataFilters(newDataFilters: WebChartDataFilters | undefined): Promise<void> | |
setDataTooltipValueFormat inherited | setDataTooltipValueFormat(seriesIndex: number, valueFormat: NumberFormatOptions | undefined): void | |
setGuideAbove inherited | setGuideAbove(above: boolean, index?: number, orientation?: GuideOrientation): void | |
setGuideEnd inherited | setGuideEnd(end: Date | number | string | null | undefined, index?: number, orientation?: GuideOrientation): void | |
setGuideLabelText inherited | setGuideLabelText(labelText: string, index?: number, orientation?: GuideOrientation): void | |
setGuideName inherited | setGuideName(name: string, index?: number, orientation?: GuideOrientation): void | |
setGuideStart inherited | setGuideStart(start: Date | number | string | null, index?: number, orientation?: GuideOrientation): void | |
setGuideStyle inherited | setGuideStyle(style: ISimpleFillSymbol | ISimpleLineSymbol, index?: number, orientation?: GuideOrientation): void | |
setGuideVisibility inherited | setGuideVisibility(visible: boolean, index?: number, orientation?: GuideOrientation): void | |
setSeriesVisibility inherited | setSeriesVisibility(props: LegendItemVisibility): void | |
setTooltipReverseColor inherited | setTooltipReverseColor(reverseColor: boolean, index: number, orientation?: GuideOrientation): void | |
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
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
getGuideAbove
- Signature
-
getGuideAbove (index?: number, orientation?: GuideOrientation): boolean
Gets whether the guide should be rendered above the other chart elements.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| index | Default | | |
| orientation | Default | |
- Returns
- boolean
getGuideEnd
- Signature
-
getGuideEnd (index?: number, orientation?: GuideOrientation): Date | number | string | null | undefined
Gets the end value of a guide.
getGuideLabelText
- Signature
-
getGuideLabelText (index?: number, orientation?: GuideOrientation): string | undefined
Gets the guide label text.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| index | Default | | |
| orientation | Default | |
getGuideName
- Signature
-
getGuideName (index?: number, orientation?: GuideOrientation): string | undefined
Gets the name of a guide.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| index | Default | | |
| orientation | Default | |
getGuideStart
- Signature
-
getGuideStart (index?: number, orientation?: GuideOrientation): Date | number | string | null
Gets the start value of a guide.
getGuideStyle
- Signature
-
getGuideStyle (index?: number, orientation?: GuideOrientation): ISimpleFillSymbol | ISimpleLineSymbol | undefined
Gets the guide style.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| index | Default | | |
| orientation | Default | |
- Returns
- ISimpleFillSymbol | ISimpleLineSymbol | undefined
getGuideVisibility
- Signature
-
getGuideVisibility (index?: number, orientation?: GuideOrientation): boolean
Gets whether a guide is visible.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| index | Default | | |
| orientation | Default | |
- Returns
- boolean
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.
getTooltipReverseColor
- Signature
-
getTooltipReverseColor (index: number, orientation?: GuideOrientation): boolean
Gets whether the tooltip text color should be reversed for a guide.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| index | The index of the guide in the list of guides for the given axis orientation. | | |
| orientation | The axis orientation of the guide. | |
- Returns
- boolean
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
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
setGuideAbove
- Signature
-
setGuideAbove (above: boolean, index?: number, orientation?: GuideOrientation): void
Sets whether the guide should be rendered above the other chart elements.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| above | New above boolean to set. | | |
| index | Default | | |
| orientation | Default | |
- Returns
- void
setGuideEnd
- Signature
-
setGuideEnd (end: Date | number | string | null | undefined, index?: number, orientation?: GuideOrientation): void
Sets the end value of a guide.
Parameters
- Returns
- void
setGuideLabelText
- Signature
-
setGuideLabelText (labelText: string, index?: number, orientation?: GuideOrientation): void
Sets the guide label text.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| labelText | New label text to set. | | |
| index | Default | | |
| orientation | Default | |
- Returns
- void
setGuideName
- Signature
-
setGuideName (name: string, index?: number, orientation?: GuideOrientation): void
Sets the name of a guide.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| name | New name to set. | | |
| index | Default | | |
| orientation | Default | |
- Returns
- void
setGuideStart
- Signature
-
setGuideStart (start: Date | number | string | null, index?: number, orientation?: GuideOrientation): void
Sets the start value of a guide.
setGuideStyle
- Signature
-
setGuideStyle (style: ISimpleFillSymbol | ISimpleLineSymbol, index?: number, orientation?: GuideOrientation): void
Sets the guide style.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| style | New style to set. | | |
| index | Default | | |
| orientation | Default | |
- Returns
- void
Example
chartModel.setGuideStyle( { type: "esriSLS", color: [0, 200, 0, 255], width: 2, }, 1,); setGuideVisibility
- Signature
-
setGuideVisibility (visible: boolean, index?: number, orientation?: GuideOrientation): void
Sets whether a guide is visible.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| visible | New visibility to set. | | |
| index | Default | | |
| orientation | Default | |
- Returns
- void
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
setTooltipReverseColor
- Signature
-
setTooltipReverseColor (reverseColor: boolean, index: number, orientation?: GuideOrientation): void
Sets whether the tooltip text color should be reversed for a guide.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| reverseColor | New reverseColor boolean to set. | | |
| index | The index of the guide in the list of guides for the given axis orientation. | | |
| orientation | The axis orientation of the guide. | |
- 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. | |
update
- Signature
-
update (): Promise<void>
Can be awaited to allow any pending async updates to complete.