Skip to content
ESM
import { ModelWithYGuides } from "@arcgis/charts-components/model/mixins/model-with-y-guides.js";
Inheritance:
ModelWithYGuidesmodel-with-guideschart-modelchart-model-baseEventTarget
Subclasses:
serial-chart-model, box-plot-model, histogram-model, scatterplot-model

Constructors

Constructor

inherited Constructor
Inherited from: ChartModelBase
Parameters
ParameterTypeDescriptionRequired
args
any[]

Properties

asyncUpdatesPromise

inherited Property
Type
Promise<void>
Inherited from: ChartModelBase

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

inherited Property
Type
Color | undefined
Inherited from: WithBackgroundColor

The background color of the chart.

chartId

inherited Property
Type
string | undefined
Inherited from: WithChartId

The chart ID.

chartRenderer

autocast inherited Property
Type
IDrawingInfo["renderer"] | undefined
Inherited from: WithChartRenderer

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

inherited Property
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

readonlyinherited Property
Type
ChartSubType
Inherited from: WithChartSubType

The chart sub type of the series.

chartTitleVisibility

inherited Property
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.

chartType

readonlyinherited Property
Type
ChartTypes
Inherited from: ChartModelBase

The chart type.

config

inherited Property
Type
ChartConfig
Inherited from: WithConfig

The current chart configuration object.

dataStore

inherited Property
Type
any
Inherited from: ChartModelBase

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

descriptionSymbol

inherited Property
Type
WebChartTextSymbol | undefined
Inherited from: WithDescriptionSymbol

The description text symbol. Contains styling information such as font, color, and symbol style.

descriptionText

inherited Property
Type
string
Inherited from: WithDescriptionText

descriptionVisibility

inherited Property
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

inherited Property
Type
boolean
Inherited from: WithFetchNULLValues

Whether to fetch null values for them to be counted or displayed as categories on the chart.

guideLabelsSymbol

inherited Property
Type
WebChartTextSymbol | undefined
Inherited from: ModelWithGuides

The guide labels text symbol (font, color, style).

layer

readonlyinherited Property
Type
SupportedLayer | undefined
Inherited from: WithLayer

The chart model's layer.

seriesLength

readonlyinherited Property
Type
number
Inherited from: WithSeriesLength

The length of the series array.

splitByValues

readonlyinherited Property
Type
string[]
Inherited from: WithSplitByValues

The split-by values for the chart.

subtitleSymbol

inherited Property
Type
WebChartTextSymbol | undefined
Inherited from: WithSubtitleSymbol

The subtitle text symbol. Contains styling information such as font, color, and symbol style.

subtitleText

inherited Property
Type
string
Inherited from: WithSubtitleText

The chart subtitle text.

titleSymbol

inherited Property
Type
WebChartTextSymbol | undefined
Inherited from: WithTitleSymbol

The title text symbol. Contains styling information such as font, color, and symbol style.

titleText

inherited Property
Type
string
Inherited from: WithTitleText

The chart title text.

version

readonlyinherited Property
Type
string | undefined
Inherited from: WithVersion

The version of the chart configuration.

Methods

MethodSignatureClass
addYAxisGuide(name: string, index?: number): void
deleteYAxisGuide(index?: number): void
generateChartTitle
inherited
generateChartTitle(): string
getDataFilters
inherited
getDataFilters(): WebChartDataFilters | undefined
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(seriesIndex: number): boolean
getTooltipReverseColor(index: number, orientation?: GuideOrientation): boolean
getYGuidesLength(): number | undefined
isSameChartAs
inherited
isSameChartAs(otherModel: ChartModel | undefined): boolean
setDataFilters
inherited
setDataFilters(newDataFilters: WebChartDataFilters | undefined): Promise<void>
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(props: LegendItemVisibility): void
setTooltipReverseColor(reverseColor: boolean, index: number, orientation?: GuideOrientation): void
setup
inherited
setup(params: ModelParams<ChartConfig>): Promise<void>
update
inherited
update(): Promise<void>

addYAxisGuide

Method
Signature
addYAxisGuide (name: string, index?: number): void

Adds a Y-axis guide.

Parameters
ParameterTypeDescriptionRequired
name

The name of the guide.

index

The index to insert the new guide in the list of Y-axis guides. If left undefined, the guide is appended to the end of the list.

Returns
void

deleteYAxisGuide

Method
Signature
deleteYAxisGuide (index?: number): void

Deletes a Y-axis guide.

Parameters
ParameterTypeDescriptionRequired
index

The index of the guide to delete in the list of Y-axis guides. If left undefined, the last guide in the list is deleted.

Returns
void

generateChartTitle

inherited Method
Signature
generateChartTitle (): string
Inherited from: ChartModelBase

Generate the proper chart title from the current config.

Returns
string

getDataFilters

inherited Method
Signature
getDataFilters (): WebChartDataFilters | undefined
Inherited from: WithDataFilters

Gets the data filter for the bar chart.

getDataTooltipValueFormat

inherited Method
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
ParameterTypeDescriptionRequired
seriesIndex

The index of the series to retrieve the value format for.

Returns
NumberFormatOptions | undefined

getGuideAbove

inherited Method
Signature
getGuideAbove (index?: number, orientation?: GuideOrientation): boolean
Inherited from: ModelWithGuides

Gets whether the guide should be rendered above the other chart elements.

Parameters
ParameterTypeDescriptionRequired
index

Default 0. The index of the guide in the list of guides for the given axis orientation.

orientation

Default y. The axis orientation of the guide.

Returns
boolean

getGuideEnd

inherited Method
Signature
getGuideEnd (index?: number, orientation?: GuideOrientation): Date | number | string | null | undefined
Inherited from: ModelWithGuides

Gets the end value of a guide.

Parameters
ParameterTypeDescriptionRequired
index

Default 0. The index of the guide in the list of guides for the given axis orientation.

orientation

Default y. The axis orientation of the guide.

Returns
Date | number | string | null | undefined

getGuideLabelText

inherited Method
Signature
getGuideLabelText (index?: number, orientation?: GuideOrientation): string | undefined
Inherited from: ModelWithGuides

Gets the guide label text.

Parameters
ParameterTypeDescriptionRequired
index

Default 0. The index of the guide in the list of guides for the given axis orientation.

orientation

Default y. The axis orientation of the guide.

Returns
string | undefined

getGuideName

inherited Method
Signature
getGuideName (index?: number, orientation?: GuideOrientation): string | undefined
Inherited from: ModelWithGuides

Gets the name of a guide.

Parameters
ParameterTypeDescriptionRequired
index

Default 0. The index of the guide in the list of guides for the given axis orientation.

orientation

Default y. The axis orientation of the guide.

Returns
string | undefined

getGuideStart

inherited Method
Signature
getGuideStart (index?: number, orientation?: GuideOrientation): Date | number | string | null
Inherited from: ModelWithGuides

Gets the start value of a guide.

Parameters
ParameterTypeDescriptionRequired
index

Default 0. The index of the guide in the list of guides for the given axis orientation.

orientation

Default y. The axis orientation of the guide.

Returns
Date | number | string | null

getGuideStyle

inherited Method
Signature
getGuideStyle (index?: number, orientation?: GuideOrientation): ISimpleFillSymbol | ISimpleLineSymbol | undefined
Inherited from: ModelWithGuides

Gets the guide style.

Parameters
ParameterTypeDescriptionRequired
index

Default 0. The index of the guide in the list of guides for the given axis orientation.

orientation

Default y. The axis orientation of the guide.

Returns
ISimpleFillSymbol | ISimpleLineSymbol | undefined

getGuideVisibility

inherited Method
Signature
getGuideVisibility (index?: number, orientation?: GuideOrientation): boolean
Inherited from: ModelWithGuides

Gets whether a guide is visible.

Parameters
ParameterTypeDescriptionRequired
index

Default 0. The index of the guide in the list of guides for the given axis orientation.

orientation

Default y. The axis orientation of the guide.

Returns
boolean

getSeriesId

inherited Method
Signature
getSeriesId (seriesIndex: number): string | undefined
Inherited from: WithSeriesId

Gets the series ID for a given series index. If the series index is out of bounds, this function will return undefined.

Parameters
ParameterTypeDescriptionRequired
seriesIndex

The index of the series.

Returns
string | undefined

getSeriesIndex

inherited Method
Signature
getSeriesIndex (seriesId: string): number | undefined
Inherited from: WithSeriesIndex

Gets the series index for a given series ID. If the series ID is not found, this function will return undefined.

Parameters
ParameterTypeDescriptionRequired
seriesId

The ID of the series.

Returns
number | undefined

getSeriesVisibility

inherited Method
Signature
getSeriesVisibility (seriesIndex: number): boolean
Inherited from: WithSeriesVisibility

Gets the visibility of a series.

Parameters
ParameterTypeDescriptionRequired
seriesIndex

The series index

Returns
boolean

getTooltipReverseColor

inherited Method
Signature
getTooltipReverseColor (index: number, orientation?: GuideOrientation): boolean
Inherited from: ModelWithGuides

Gets whether the tooltip text color should be reversed for a guide.

Parameters
ParameterTypeDescriptionRequired
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

getYGuidesLength

Method
Signature
getYGuidesLength (): number | undefined

Gets the number guides in the Y-axis guides list.

Returns
number | undefined

The number of Y-axis guides.

isSameChartAs

inherited Method
Signature
isSameChartAs (otherModel: ChartModel | undefined): boolean
Inherited from: ChartModelBase

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

setDataFilters

inherited Method
Signature
setDataFilters (newDataFilters: WebChartDataFilters | undefined): Promise<void>
Inherited from: WithDataFilters

Sets the data filter for the chart.

Parameters
ParameterTypeDescriptionRequired
newDataFilters

The new data filter.

Returns
Promise<void>

setDataTooltipValueFormat

inherited Method
Signature
setDataTooltipValueFormat (seriesIndex: number, valueFormat: NumberFormatOptions | undefined): void

Sets the data tooltip value format for a series.

Parameters
ParameterTypeDescriptionRequired
seriesIndex

The index of the series to set the value format for.

valueFormat

The value format to set.

Returns
void

setGuideAbove

inherited Method
Signature
setGuideAbove (above: boolean, index?: number, orientation?: GuideOrientation): void
Inherited from: ModelWithGuides

Sets whether the guide should be rendered above the other chart elements.

Parameters
ParameterTypeDescriptionRequired
above

New above boolean to set.

index

Default 0. The index of the guide in the list of guides for the given axis orientation.

orientation

Default y. The axis orientation of the guide.

Returns
void

setGuideEnd

inherited Method
Signature
setGuideEnd (end: Date | number | string | null | undefined, index?: number, orientation?: GuideOrientation): void
Inherited from: ModelWithGuides

Sets the end value of a guide.

Parameters
ParameterTypeDescriptionRequired
end

New end value to set.

index

Default 0. The index of the guide in the list of guides for the given axis orientation.

orientation

Default y. The axis orientation of the guide.

Returns
void

setGuideLabelText

inherited Method
Signature
setGuideLabelText (labelText: string, index?: number, orientation?: GuideOrientation): void
Inherited from: ModelWithGuides

Sets the guide label text.

Parameters
ParameterTypeDescriptionRequired
labelText

New label text to set.

index

Default 0. The index of the guide in the list of guides for the given axis orientation.

orientation

Default y. The axis orientation of the guide.

Returns
void

setGuideName

inherited Method
Signature
setGuideName (name: string, index?: number, orientation?: GuideOrientation): void
Inherited from: ModelWithGuides

Sets the name of a guide.

Parameters
ParameterTypeDescriptionRequired
name

New name to set.

index

Default 0. The index of the guide in the list of guides for the given axis orientation.

orientation

Default y. The axis orientation of the guide.

Returns
void

setGuideStart

inherited Method
Signature
setGuideStart (start: Date | number | string | null, index?: number, orientation?: GuideOrientation): void
Inherited from: ModelWithGuides

Sets the start value of a guide.

Parameters
ParameterTypeDescriptionRequired
start

New start value to set.

index

Default 0. The index of the guide in the list of guides for the given axis orientation.

orientation

Default y. The axis orientation of the guide.

Returns
void

setGuideStyle

inherited Method
Signature
setGuideStyle (style: ISimpleFillSymbol | ISimpleLineSymbol, index?: number, orientation?: GuideOrientation): void
Inherited from: ModelWithGuides

Sets the guide style.

Parameters
ParameterTypeDescriptionRequired
style

New style to set.

index

Default 0. The index of the guide in the list of guides for the given axis orientation.

orientation

Default y. The axis orientation of the guide.

Returns
void
Example
chartModel.setGuideStyle(
{
type: "esriSLS",
color: [0, 200, 0, 255],
width: 2,
},
1,
);

setGuideVisibility

inherited Method
Signature
setGuideVisibility (visible: boolean, index?: number, orientation?: GuideOrientation): void
Inherited from: ModelWithGuides

Sets whether a guide is visible.

Parameters
ParameterTypeDescriptionRequired
visible

New visibility to set.

index

Default 0. The index of the guide in the list of guides for the given axis orientation.

orientation

Default y. The axis orientation of the guide.

Returns
void

setSeriesVisibility

inherited Method
Signature
setSeriesVisibility (props: LegendItemVisibility): void
Inherited from: WithSeriesVisibility

Sets the visibility of a series.

Parameters
ParameterTypeDescriptionRequired
props

Visibility options for the series.

Returns
void

setTooltipReverseColor

inherited Method
Signature
setTooltipReverseColor (reverseColor: boolean, index: number, orientation?: GuideOrientation): void
Inherited from: ModelWithGuides

Sets whether the tooltip text color should be reversed for a guide.

Parameters
ParameterTypeDescriptionRequired
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

inherited Method
Signature
setup (params: ModelParams<ChartConfig>): Promise<void>
Inherited from: ChartModelBase

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

inherited Method
Signature
update (): Promise<void>
Inherited from: ChartModelBase

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

Returns
Promise<void>