Skip to content

Pie Chart Model

Properties

dataStore

Type: any

Description: Data store object that can be used to store any data needed for the chart.
Default: {}

setupFinished

Type: Promise

Description: 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.
Default: ...

aggregationType

Type: WebChartStatisticType

Description: Aggregation type for the pie chart.

alignDataLabels

Type: undefined | boolean

Description: Align data labels setting for the pie chart.

backgroundColor

Type: undefined | Color

Description: The background color of the chart.

category

Type: string

Description: Category field for the pie chart.

chartId

Type: undefined | string

Description: The chart ID.

chartRenderer

Type: any

Description: The chart renderer.

chartSubtitleVisibility

Type: boolean

Description: Whether or not the chart subtitle is visible.
true: Chart subtitle is visible.
false: Chart subtitle is hidden.
Note: Even if the subtitle is visible, it may not be displayed if the subtitle text is empty.

chartSubType

Type: ChartSubType

Description: The chart sub type of the series.

chartTitleVisibility

Type: boolean

Description: Whether or not the chart title is visible.
true: Chart title is visible.
false: Chart title is hidden.
Note: Even if the title is visible, it may not be displayed if the title text is empty.

chartType

Type: ChartTypes

Description: The chart type.

colorMatch

Type: boolean

Description: Whether the chart should attempt to match the data source's colors.

true: Attempt to match the data source's colors.

false: Use the colors defined in the config.

config

Type: ChartConfig

Description: The current chart configuration object.

dataLabelsInside

Type: undefined | boolean

Description: Setting for placing the data labels inside of the slices.

dataLabelsOffset

Type: number

Description: Offset for the data labels.

dataLabelsSymbol

Type: undefined | WebChartTextSymbol

Description: Data labels text symbol (font, color, style).

dataLabelsVisibility

Type: boolean

Description: Whether data labels are visible.
true: visible, false: hidden.

decimalPlaces

Type: number

Description: Number of decimal places to display in the slice values.

descriptionSymbol

Type: undefined | WebChartTextSymbol

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

descriptionText

Type: string

Description: The chart description text.

descriptionVisibility

Type: boolean

Description: Whether or not the chart description is visible.
true: Description is visible.
false: Description is hidden.
Note: Even if the description is visible, it may not be displayed if the description text is empty.

displayCategoryValueOnTooltip

Type: boolean

Description: Display category value on tooltip setting from the chart config.

displayNumericValueOnTooltip

Type: boolean

Description: Display numeric value on tooltip setting from the chart config.

displayPercentageOnTooltip

Type: boolean

Description: Display percentage on tooltip setting from the chart config.

displayType

Type: PieChartSlicesDisplay

Description: Display type for the pie chart slices. Specifies whether to display the slices as a percentage, value, or both.

endAngle

Type: undefined | null | number

Description: End angle of the pie chart.

fetchNULLValues

Type: boolean

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

groupedSliceIds

Type: string[]

Description: Array of grouped slice ids for the pie chart.

groupingThreshold

Type: number

Description: Threshold below which slices will be grouped.

innerRadiusSize

Type: number

Description: Inner radius size for the pie chart.

labelCharacterLimit

Type: null | number

Description: Character limit for the slice labels.

layer

Type: undefined | SupportedLayer

Description: The associated layer.

legendMaxHeight

Type: undefined | number

Description: Maximum legend height.

legendPosition

Type: WebChartLegendPositions

Description: Legend position: top, bottom, left, or right.

legendRoundMarker

Type: boolean

Description: Whether legend markers are rounded.

legendTextSymbol

Type: undefined | WebChartTextSymbol

Description: Legend item text symbol (font, color, style).

legendTitleSymbol

Type: undefined | WebChartTextSymbol

Description: Legend title text symbol (font, color, style).

legendTitleText

Type: string

Description: The legend title text.

legendTitleVisibility

Type: boolean

Description: Whether the legend title is visible.

true: Legend title is visible.

false: Legend title is hidden.

legendVisibility

Type: boolean

Description: Whether the legend title is visible.

true: Legend title is visible.

false: Legend title is hidden.

mode

Type: PieChartDataModes

Description: The pie chart data mode (Category or Fields).

category - The chart is using values from the category field to determine each slice.

fields - The chart is using aggregated values from the numeric fields to determine each slice.

numericFields

Type: string | string[]

Description: Numeric fields for the pie chart.

optimizeDataLabelsOverlapping

Type: undefined | boolean

Description: Optimize data labels overlapping setting for the pie chart.

orderByList

Type: string[]

Description: No description.

orderOfSlices

Type: undefined | string[]

Description: Order of the slice array by returning an array of slice ids

percentagePrefix

Type: undefined | string

Description: Prefix of the percentages of the slices.

percentageSuffix

Type: undefined | string

Description: Suffix of the percentages of the slices.

seriesLength

Type: number

Description: The length of the series array.

sliceGrouping

Type: undefined | WebChartPieChartGroupSlice

Description: Slice grouping configuration for the pie chart.

slices

Type: undefined | WebChartPieChartSlice[]

Description: Array of slices for the pie chart.

splitByValues

Type: string[]

Description: The split-by values for the chart.

startAngle

Type: undefined | null | number

Description: Start angle of the pie chart.

subtitleSymbol

Type: undefined | WebChartTextSymbol

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

subtitleText

Type: string

Description: The chart subtitle text.

ticksSymbol

Type: undefined | ISimpleLineSymbol

Description: Ticks symbol connecting slices to labels.

ticksVisibility

Type: boolean

Description: Visibility of the ticks.

titleSymbol

Type: undefined | WebChartTextSymbol

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

titleText

Type: string

Description: The chart title text.

valuePrefix

Type: undefined | string

Description: Prefix of the values of the slices.

valueSuffix

Type: undefined | string

Description: Suffix of the values of the slice.

version

Type: undefined | string

Description: The version of the chart configuration.

Methods

generateChartTitle

Signature: generateChartTitle(): string

Description: Generate the proper chart title given the current config.

Returns: string

getCustomSortValues

Signature: getCustomSortValues(): Promise

Description: Gets the list of the category values for the chart.

Returns: Promise

Async: This method is async and must be awaited.

getDataFilters

Signature: getDataFilters(): undefined | WebChartDataFilters

Description: Gets the data filter for the bar chart.

Returns: undefined | WebChartDataFilters

getDataTooltipReverseColor

Signature: getDataTooltipReverseColor(seriesIndex: number): boolean

Description: Gets the setting of the dataTooltipReverseColor property.

Parameters:

  • Optional seriesIndex: number – The index of the series.

Returns: boolean

getDataTooltipValueFormat

Signature: getDataTooltipValueFormat(seriesIndex: number): undefined | NumberFormatOptions

Description: 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:

  • seriesIndex: number – The index of the series to retrieve the value format for.

Returns: undefined | NumberFormatOptions

getDataTooltipVisibility

Signature: getDataTooltipVisibility(seriesIndex: number): boolean

Description: Gets the visibility of the data tooltips.

Parameters:

  • Optional seriesIndex: number – The index of the series.

Returns: boolean

getDisplayNumericValue

Signature: getDisplayNumericValue(): boolean

Description: Gets the setting for the display of numerical value in the legend items.

Returns: boolean

getDisplayPercentage

Signature: getDisplayPercentage(): boolean

Description: Gets the setting for the display of percentage in the legend items.

Returns: boolean

getLabelMaxWidth

Signature: getLabelMaxWidth(): number

Description: Gets the maximum width in pixel for the legend item labels.

Returns: number

getOriginalSliceName

Signature: getOriginalSliceName(sliceIndex: number): undefined | null | string | number | Date

Description: Gets the original name of the slice based on the slice index.

Parameters:

  • sliceIndex: number – No description.

Returns: undefined | null | string | number | Date

getSeriesId

Signature: getSeriesId(seriesIndex: number): undefined | string

Description: Gets the series ID for a given series index.

If the series index is out of bounds, this function will return undefined.

Parameters:

  • seriesIndex: number – The index of the series.

Returns: undefined | string

getSeriesIndex

Signature: getSeriesIndex(seriesId: string): undefined | number

Description: Gets the series index for a given series ID.

If the series ID is not found, this function will return undefined.

Parameters:

  • seriesId: string – No description.

Returns: undefined | number

getSeriesVisibility

Signature: getSeriesVisibility(seriesIndex: number): boolean

Description: Gets the visibility of a series.

Parameters:

  • seriesIndex: number – The series index

Returns: boolean

getSliceColor

Signature: getSliceColor(sliceIndex: number): undefined | Color

Description: Gets the color of the slice based on the slice index. If the index is out of bounds, this function will return undefined.

Parameters:

  • sliceIndex: number – The index of the slice.

Returns: undefined | Color

getSliceId

Signature: getSliceId(sliceIndex: number): undefined | string

Description: Gets the slice id for a given slice index. If the index is out of bounds, this function will return undefined.

Parameters:

  • sliceIndex: number – The index of the slice.

Returns: undefined | string

getSliceIndex

Signature: getSliceIndex(sliceId: string): undefined | number

Description: Gets the slice index for a given slice id. If the sliceId is not found, this function will return undefined.

Parameters:

  • sliceId: string – The id of the slice.

Returns: undefined | number

getSliceName

Signature: getSliceName(sliceIndex: number): undefined | string

Description: Gets the name of the slice based on the slice index. If the index is out of bounds, this function will return undefined.

Parameters:

  • sliceIndex: number – The index of the slice.

Returns: undefined | string

getSlicesLength

Signature: getSlicesLength(): number

Description: Gets the length of the slices array.

Returns: number

getSortOrder

Signature: getSortOrder(): PieChartDataSortingKinds

Description: Gets the sort order for the pie chart.

Returns: PieChartDataSortingKinds

isSameChartAs

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

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

Parameters:

  • otherModel: undefined | ChartModel – The other chart model to compare to.

Returns: boolean

moveCustomSortValuesInOrderByList

Signature: moveCustomSortValuesInOrderByList(fromIndex: number, toIndex: number): void

Description: Moves the custom sort values in-place for the order by list in the config.
Note: This method should be only used when the sort order is set to customSort.

Parameters:

  • fromIndex: number – The index to move the custom sort item from.
  • toIndex: number – The index to move the category item to.

Returns: void

moveSeries

Signature: moveSeries(fromIndex: number, toIndex: number): void

Description: Moves a series from one index in the series array to another.

Parameters:

  • fromIndex: number – Index to move the series from.
  • toIndex: number – Index to move the series to.

Returns: void

resetAvailable

Signature: resetAvailable(): boolean

Description: Returns whether the series styling is able to be reset.

Returns: boolean

resetSlices

Signature: resetSlices(): void

Description: Resets the slices styling to the default styling.

Returns: void

setDataFilters

Signature: setDataFilters(newDataFilters: undefined | WebChartDataFilters): Promise

Description: Shared method for all chart types.

Parameters:

  • newDataFilters: undefined | WebChartDataFilters – No description.

Returns: Promise

Async: This method is async and must be awaited.

setDataTooltipReverseColor

Signature: setDataTooltipReverseColor(reverseColor: boolean, seriesIndex: number): void

Description: Sets the setting of the dataTooltipReverseColor property.

Parameters:

  • reverseColor: boolean – Indicator of whether to reverse the color.
  • Optional seriesIndex: number – The index of the series to set the reverse color.

Returns: void

setDataTooltipValueFormat

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

Description: Sets the data tooltip value format for a series.

Parameters:

  • seriesIndex: number – The index of the series to set the value format for.
  • valueFormat: undefined | NumberFormatOptions – The value format to set.

Returns: void

setDataTooltipVisibility

Signature: setDataTooltipVisibility(visibility: boolean, seriesIndex: number): void

Description: Sets the visibility of the data tooltips.

Parameters:

  • visibility: boolean – The visibility of the data tooltips.
  • Optional seriesIndex: number – The index of the series to set the visibility.

Returns: void

setDisplayNumericValue

Signature: setDisplayNumericValue(displayNumericValue: boolean): void

Description: Sets the setting for the display of numerical value in the legend items.

Parameters:

  • displayNumericValue: boolean – The setting for the display of numerical value in the legend items

Returns: void

setDisplayPercentage

Signature: setDisplayPercentage(displayPercentage: boolean): void

Description: Sets the setting for the display of percentage in the legend items.

Parameters:

  • displayPercentage: boolean – The setting for the display of percentage in the legend items

Returns: void

setLabelMaxWidth

Signature: setLabelMaxWidth(labelMaxWidth: number): void

Description: Sets the maximum width in pixel for the legend item labels.

Parameters:

  • labelMaxWidth: number – The maximum width in pixel for the legend item labels

Returns: void

setSeriesVisibility

Signature: setSeriesVisibility(props: LegendItemVisibility): void

Description: Sets the visibility of a series.

Parameters:

  • props: LegendItemVisibility – No description.

Returns: void

setSliceColor

Signature: setSliceColor(color: undefined | Color, sliceIndex: number): void

Description: Sets the color of the slice based on the slice index.

Parameters:

  • color: undefined | Color – The color for the slice.
  • sliceIndex: number – The index of the slice.

Returns: void

setSliceName

Signature: setSliceName(name: string, sliceIndex: number): void

Description: Sets name of the slice based on the slice index.

Parameters:

  • name: string – The name for the slice.
  • sliceIndex: number – The index of the slice.

Returns: void

setSortOrder

Signature: setSortOrder(sortOrder: PieChartDataSortingKinds, orderByList: string[]): void

Description: Sets the sort order for the pie chart.

Parameters:

  • sortOrder: PieChartDataSortingKinds – The sort order.
  • Optional orderByList: string[] – No description.

Returns: void

setup

Signature: setup(params: ModelParams): Promise

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

Parameters:

  • params: ModelParams – The parameters to be used to set up the chart model.

Returns: Promise

Async: This method is async and must be awaited.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.