sy-pie-chart

Pie

Show the proportions that make up a whole.

sy-pie-chart

Use when the total is meaningful and there are few categories.

Not suitable for negative values or overlapping categories. Use bars for precise comparisons between similar values.

Base chart tier: Community. Features such as additional renderers and custom branding have separate entitlement requirements.

InputData description
valuesAn array of { name, value, color? }. Positive values determine the angles.
innerSizeThe donut's inner radius ratio.
labelsContentChoose names, values, or percentages for labels.

Complete implementation example

html
<div id="chart-container" style="width: 100%; min-width: 0;"></div>

<script type="module">
  import { defineCustomElement as define0 } from '@syidax/advanced/components/sy-pie-chart.js';
  define0();

  const specs = [
    {
      "id": "example-chart",
      "tag": "sy-pie-chart",
      "props": {
        "engine": "standard",
        "values": [
          {
            "name": "Product A",
            "value": 42,
            "color": "#8263d9"
          },
          {
            "name": "Product B",
            "value": 28,
            "color": "#239c91"
          },
          {
            "name": "Product C",
            "value": 18,
            "color": "#e99954"
          },
          {
            "name": "Other",
            "value": 12,
            "color": "#d76c8f"
          }
        ],
        "legend": true,
        "labelsContent": "name-percent",
        "width": 640,
        "height": 360,
        "brandPosition": "bottom-right",
        "brandLogo": ""
      }
    }
  ];
  const container = document.querySelector('#chart-container');
  const elements = specs.map(({ tag, id, props }) => {
    const element = document.createElement(tag);
    element.id = id;
    Object.assign(element, props);
    element.setAttribute('aria-label', 'pie example chart');
    return element;
  });
  container.replaceChildren(...elements);
  const chart = elements.at(-1);
  const onEvent = event => {
    console.log('sliceClick', event.detail);
  };
  chart.addEventListener('sliceClick', onEvent);
  const observer = new ResizeObserver(([entry]) => {
    const width = Math.max(160, Math.floor(entry.contentRect.width));
    elements.forEach(element => { element.width = width; });
  });
  observer.observe(container);

  // In an SPA, call this function when the view is disposed.
  function disposeChart() {
    observer.disconnect();
    chart.removeEventListener('sliceClick', onEvent);
    container.replaceChildren();
  }
</script>

Properties

values

An array of { name, value, color? }. Positive values determine the angles.

ItemValue
JavaScript propertyvalues
HTML attributePass objects, arrays, and callbacks as JavaScript properties
TypePieChartValues
Default[]

width

Chart width in pixels. If the container width changes, update width from a ResizeObserver.

ItemValue
JavaScript propertywidth
HTML attributewidth
Typenumber
Default480

height

Chart height in pixels. Allow space for axes, titles, and the legend.

ItemValue
JavaScript propertyheight
HTML attributeheight
Typenumber
Default360

brandPosition

The corner where the logo is anchored. Community and Pro both support all four corners, using the same position on screen and in image exports.

ItemValue
JavaScript propertybrandPosition
HTML attributebrand-position
Type'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
Default'bottom-right'
Allowed valuestop-left, top-right, bottom-left, bottom-right

palette

Allowed values: tableau10, tableau20, observable10, paired12, set3_12. Default: 'tableau10'.

ItemValue
JavaScript propertypalette
HTML attributepalette
TypePieChartPaletteName
Default'tableau10'
Allowed valuestableau10, tableau20, observable10, paired12, set3_12

colors

Pass as a JavaScript property. type: ReadonlyArray<string>.

ItemValue
JavaScript propertycolors
HTML attributePass objects, arrays, and callbacks as JavaScript properties
TypeReadonlyArray<string>
Defaultundefined

undefined means this property was not explicitly set. The effective value may depend on the chart type and other settings.

borderColor

Set as an HTML attribute or JavaScript property. type: string.

ItemValue
JavaScript propertyborderColor
HTML attributeborder-color
Typestring
Default'#ffffff'

borderWidth

Set as an HTML attribute or JavaScript property. type: number.

ItemValue
JavaScript propertyborderWidth
HTML attributeborder-width
Typenumber
Default1

slicedOffset

Set as an HTML attribute or JavaScript property. type: number.

ItemValue
JavaScript propertyslicedOffset
HTML attributesliced-offset
Typenumber
Default10

innerSize

The donut's inner radius ratio.

ItemValue
JavaScript propertyinnerSize
HTML attributePass objects, arrays, and callbacks as JavaScript properties
Typenumber | string
Defaultundefined

undefined means this property was not explicitly set. The effective value may depend on the chart type and other settings.

size

Pass as a JavaScript property. type: number | string.

ItemValue
JavaScript propertysize
HTML attributePass objects, arrays, and callbacks as JavaScript properties
Typenumber | string
Defaultundefined

undefined means this property was not explicitly set. The effective value may depend on the chart type and other settings.

centerX

Pass as a JavaScript property. type: number | string.

ItemValue
JavaScript propertycenterX
HTML attributePass objects, arrays, and callbacks as JavaScript properties
Typenumber | string
Defaultundefined

undefined means this property was not explicitly set. The effective value may depend on the chart type and other settings.

centerY

Pass as a JavaScript property. type: number | string.

ItemValue
JavaScript propertycenterY
HTML attributePass objects, arrays, and callbacks as JavaScript properties
Typenumber | string
Defaultundefined

undefined means this property was not explicitly set. The effective value may depend on the chart type and other settings.

minSize

Set as an HTML attribute or JavaScript property. type: number.

ItemValue
JavaScript propertyminSize
HTML attributemin-size
Typenumber
Default80

thickness

Set as an HTML attribute or JavaScript property. type: number.

ItemValue
JavaScript propertythickness
HTML attributethickness
Typenumber
Defaultundefined

undefined means this property was not explicitly set. The effective value may depend on the chart type and other settings.

startAngle

Set as an HTML attribute or JavaScript property. type: number.

ItemValue
JavaScript propertystartAngle
HTML attributestart-angle
Typenumber
Default0

endAngle

Set as an HTML attribute or JavaScript property. type: number.

ItemValue
JavaScript propertyendAngle
HTML attributeend-angle
Typenumber
Default360

variableRadius

Variable-radius mode (Highcharts variablepie). Each datum's z maps to the slice's outer radius between min-point-size and max-point-size while value keeps owning the angular sweep. Data without any finite z renders as a uniform pie even when this is on.

ItemValue
JavaScript propertyvariableRadius
HTML attributevariable-radius
Typeboolean
Defaultfalse

sizeBy

'area' (default) scales slice AREA linearly with z (radius ∝ √z̄); 'radius' scales the radius linearly.

ItemValue
JavaScript propertysizeBy
HTML attributesize-by
TypePieChartSizeBy
Default'area'
Allowed valuesarea, radius

zMin

Lower z-domain bound. Defaults to the data minimum; smaller z clamp to the minimum radius.

ItemValue
JavaScript propertyzMin
HTML attributez-min
Typenumber
Defaultundefined

undefined means this property was not explicitly set. The effective value may depend on the chart type and other settings.

zMax

Upper z-domain bound. Defaults to the data maximum; larger z clamp to the maximum radius.

ItemValue
JavaScript propertyzMax
HTML attributez-max
Typenumber
Defaultundefined

undefined means this property was not explicitly set. The effective value may depend on the chart type and other settings.

minPointSize

Smallest slice outer DIAMETER — px number or '%' of the full outer diameter (Highcharts minPointSize).

ItemValue
JavaScript propertyminPointSize
HTML attributePass objects, arrays, and callbacks as JavaScript properties
Typenumber | string
Default'10%'

maxPointSize

Largest slice outer DIAMETER — px number or '%' of the full outer diameter (Highcharts maxPointSize).

ItemValue
JavaScript propertymaxPointSize
HTML attributePass objects, arrays, and callbacks as JavaScript properties
Typenumber | string
Default'100%'

centerText

Set as an HTML attribute or JavaScript property. type: string.

ItemValue
JavaScript propertycenterText
HTML attributecenter-text
Typestring
Defaultundefined

undefined means this property was not explicitly set. The effective value may depend on the chart type and other settings.

centerSubtext

Set as an HTML attribute or JavaScript property. type: string.

ItemValue
JavaScript propertycenterSubtext
HTML attributecenter-subtext
Typestring
Defaultundefined

undefined means this property was not explicitly set. The effective value may depend on the chart type and other settings.

chartTitle

The title inside the chart. Explain the data's unit and meaning alongside it.

ItemValue
JavaScript propertychartTitle
HTML attributechart-title
Typestring
Defaultundefined

undefined means this property was not explicitly set. The effective value may depend on the chart type and other settings.

chartSubtitle

The subtitle inside the chart.

ItemValue
JavaScript propertychartSubtitle
HTML attributechart-subtitle
Typestring
Defaultundefined

undefined means this property was not explicitly set. The effective value may depend on the chart type and other settings.

legend

Whether to show a legend for series or items.

ItemValue
JavaScript propertylegend
HTML attributelegend
Typeboolean
Defaultfalse

legendPosition

Where the legend is positioned.

ItemValue
JavaScript propertylegendPosition
HTML attributelegend-position
TypePieChartLegendPosition
Default'bottom'
Allowed valuestop, bottom, left, right

legendItems

Pass as a JavaScript property. type: LegendItem[].

ItemValue
JavaScript propertylegendItems
HTML attributePass objects, arrays, and callbacks as JavaScript properties
TypeLegendItem[]
Defaultundefined

undefined means this property was not explicitly set. The effective value may depend on the chart type and other settings.

labelsMode

Allowed values: none, auto, inside, outside. Default: 'none'.

ItemValue
JavaScript propertylabelsMode
HTML attributelabels-mode
TypePieChartLabelMode
Default'none'
Allowed valuesnone, auto, inside, outside

labelsContent

Choose names, values, or percentages for labels.

ItemValue
JavaScript propertylabelsContent
HTML attributePass objects, arrays, and callbacks as JavaScript properties
TypePieChartLabelContent
Default'name-percent'
Literals in the typepercent, value, name, name-percent, name-value

labelsDistance

Set as an HTML attribute or JavaScript property. type: number.

ItemValue
JavaScript propertylabelsDistance
HTML attributelabels-distance
Typenumber
Default24

labelsFontSize

Set as an HTML attribute or JavaScript property. type: number.

ItemValue
JavaScript propertylabelsFontSize
HTML attributelabels-font-size
Typenumber
Default12

labelsFontWeight

Set as an HTML attribute or JavaScript property. type: number.

ItemValue
JavaScript propertylabelsFontWeight
HTML attributelabels-font-weight
Typenumber
Default500

labelsColor

Set as an HTML attribute or JavaScript property. type: string.

ItemValue
JavaScript propertylabelsColor
HTML attributelabels-color
Typestring
Default'#1f2937'

labelsMinSweep

Set as an HTML attribute or JavaScript property. type: number.

ItemValue
JavaScript propertylabelsMinSweep
HTML attributelabels-min-sweep
Typenumber
Default0.02

labelsConnector

Set as an HTML attribute or JavaScript property. type: boolean.

ItemValue
JavaScript propertylabelsConnector
HTML attributelabels-connector
Typeboolean
Defaulttrue

labelsConnectorColor

Set as an HTML attribute or JavaScript property. type: string.

ItemValue
JavaScript propertylabelsConnectorColor
HTML attributelabels-connector-color
Typestring
Default'#9ca3af'

labelsConnectorWidth

Set as an HTML attribute or JavaScript property. type: number.

ItemValue
JavaScript propertylabelsConnectorWidth
HTML attributelabels-connector-width
Typenumber
Default1

labelsConnectorPadding

Set as an HTML attribute or JavaScript property. type: number.

ItemValue
JavaScript propertylabelsConnectorPadding
HTML attributelabels-connector-padding
Typenumber
Default5

labelsConnectorShape

Allowed values: straight, crooked. Default: 'crooked'.

ItemValue
JavaScript propertylabelsConnectorShape
HTML attributelabels-connector-shape
Type'crooked' | 'straight'
Default'crooked'
Allowed valuesstraight, crooked

labelsAllowOverlap

Set as an HTML attribute or JavaScript property. type: boolean.

ItemValue
JavaScript propertylabelsAllowOverlap
HTML attributelabels-allow-overlap
Typeboolean
Defaultfalse

tooltipShow

Whether to display the built-in tooltip.

ItemValue
JavaScript propertytooltipShow
HTML attributetooltip-show
Typeboolean
Defaulttrue

tooltipFormat

Pass as a JavaScript property. type: (slice: PieChartResolvedSlice) => string.

ItemValue
JavaScript propertytooltipFormat
HTML attributePass objects, arrays, and callbacks as JavaScript properties
Type(slice: PieChartResolvedSlice) => string
Defaultundefined

undefined means this property was not explicitly set. The effective value may depend on the chart type and other settings.

enableMouseTracking

Set as an HTML attribute or JavaScript property. type: boolean.

ItemValue
JavaScript propertyenableMouseTracking
HTML attributeenable-mouse-tracking
Typeboolean
Defaulttrue

stickyTracking

Set as an HTML attribute or JavaScript property. type: boolean.

ItemValue
JavaScript propertystickyTracking
HTML attributesticky-tracking
Typeboolean
Defaultfalse

tooltip

Rich tooltip configuration object — the slice-flavoured counterpart to the cartesian .tooltip API. Enables trigger (hover/click/hover-click), openMode (single/multiple pinned), connector, draggable, interactive action buttons, custom format/html/style/className/side and fixed sizing. When set it takes precedence over the flat tooltip-show / tooltipFormat props (which stay for back-compat). Property-only — assign the object, not an attribute.

ItemValue
JavaScript propertytooltip
HTML attributePass objects, arrays, and callbacks as JavaScript properties
TypePieChartTooltipInput
Defaultundefined
Literals in the typeauto, off

undefined means this property was not explicitly set. The effective value may depend on the chart type and other settings.

allowSelect

Set as an HTML attribute or JavaScript property. type: boolean.

ItemValue
JavaScript propertyallowSelect
HTML attributeallow-select
Typeboolean
Defaulttrue

inactiveOtherSlices

Set as an HTML attribute or JavaScript property. type: boolean.

ItemValue
JavaScript propertyinactiveOtherSlices
HTML attributeinactive-other-slices
Typeboolean
Defaultfalse

inactiveSliceOpacity

Set as an HTML attribute or JavaScript property. type: number.

ItemValue
JavaScript propertyinactiveSliceOpacity
HTML attributeinactive-slice-opacity
Typenumber
Default0.45

activeSliceIndex

Set as an HTML attribute or JavaScript property. type: number.

ItemValue
JavaScript propertyactiveSliceIndex
HTML attributeactive-slice-index
Typenumber
Defaultundefined

undefined means this property was not explicitly set. The effective value may depend on the chart type and other settings.

engine

Renderer selection: auto, standard, or pro. Engine selection is separate from permission to use a Pro chart type.

ItemValue
JavaScript propertyengine
HTML attributeengine
TypePieChartEngineMode
Default'auto'
Allowed valuesauto, standard, pro

proThreshold

Set as an HTML attribute or JavaScript property. type: number.

ItemValue
JavaScript propertyproThreshold
HTML attributepro-threshold
Typenumber
Default50_000

unavailable

Allowed values: fallback, error, throw. Default: 'fallback'.

ItemValue
JavaScript propertyunavailable
HTML attributeunavailable
TypePieChartUnavailableBehaviour
Default'fallback'
Allowed valuesfallback, error, throw

streamSource

A stream source for live data. Check the contract for the specific type.

ItemValue
JavaScript propertystreamSource
HTML attributePass objects, arrays, and callbacks as JavaScript properties
TypePieChartStreamSource
Defaultundefined

undefined means this property was not explicitly set. The effective value may depend on the chart type and other settings.

streamWindow

The streaming data range to keep visible.

ItemValue
JavaScript propertystreamWindow
HTML attributestream-window
Typenumber
Defaultundefined

undefined means this property was not explicitly set. The effective value may depend on the chart type and other settings.

streamMax

The maximum number of streaming data points to retain.

ItemValue
JavaScript propertystreamMax
HTML attributestream-max
Typenumber
Defaultundefined

undefined means this property was not explicitly set. The effective value may depend on the chart type and other settings.

animated

Whether to animate initial display and data changes.

ItemValue
JavaScript propertyanimated
HTML attributeanimate
Typeboolean
Defaultfalse

animationDuration

Animation duration in milliseconds.

ItemValue
JavaScript propertyanimationDuration
HTML attributeanimation-duration
Typenumber
Default600

animationEasing

Allowed values: linear, ease-out, ease-in, ease-in-out. Default: 'ease-out'.

ItemValue
JavaScript propertyanimationEasing
HTML attributeanimation-easing
TypePieChartEasing
Default'ease-out'
Allowed valueslinear, ease-out, ease-in, ease-in-out

animationType

Allowed values: initial, update. Default: undefined.

ItemValue
JavaScript propertyanimationType
HTML attributeanimation-type
TypePieChartAnimationType
Defaultundefined
Allowed valuesinitial, update

undefined means this property was not explicitly set. The effective value may depend on the chart type and other settings.

Events

rendered

Emits rendering results in detail when chart drawing completes.

Event name: rendered. Names are case-sensitive. Read the payload from detail on CustomEvent<PieChartRenderResult & { tier: PieChartEngineTier }>.

javascript
chart.addEventListener('rendered', event => {
  console.log(event.detail); // PieChartRenderResult & { tier: PieChartEngineTier }
});

sliceClick

CustomEvent.detail type: PieChartSliceEventDetail. Event names are case-sensitive.

Event name: sliceClick. Names are case-sensitive. Read the payload from detail on CustomEvent<PieChartSliceEventDetail>.

javascript
chart.addEventListener('sliceClick', event => {
  console.log(event.detail); // PieChartSliceEventDetail
});

sliceHover

CustomEvent.detail type: PieChartSliceEventDetail | null. Event names are case-sensitive.

Event name: sliceHover. Names are case-sensitive. Read the payload from detail on CustomEvent<PieChartSliceEventDetail | null>.

javascript
chart.addEventListener('sliceHover', event => {
  console.log(event.detail); // PieChartSliceEventDetail | null
});

pointContextMenu

CustomEvent.detail type: ChartPointContextMenuEventDetail<PieChartSliceEventDetail>. Event names are case-sensitive.

Event name: pointContextMenu. Names are case-sensitive. Read the payload from detail on CustomEvent<ChartPointContextMenuEventDetail<PieChartSliceEventDetail>>.

javascript
chart.addEventListener('pointContextMenu', event => {
  console.log(event.detail); // ChartPointContextMenuEventDetail<PieChartSliceEventDetail>
});

sliceSelected

CustomEvent.detail type: PieChartSelectedEventDetail. Event names are case-sensitive.

Event name: sliceSelected. Names are case-sensitive. Read the payload from detail on CustomEvent<PieChartSelectedEventDetail>.

javascript
chart.addEventListener('sliceSelected', event => {
  console.log(event.detail); // PieChartSelectedEventDetail
});

legendItemClick

CustomEvent.detail type: { index: number; sliceId: string; label: string; disabled: boolean }. Event names are case-sensitive.

Event name: legendItemClick. Names are case-sensitive. Read the payload from detail on CustomEvent<{ index: number; sliceId: string; label: string; disabled: boolean }>.

javascript
chart.addEventListener('legendItemClick', event => {
  console.log(event.detail); // { index: number; sliceId: string; label: string; disabled: boolean }
});

sliceToggled

CustomEvent.detail type: { index: number; sliceId: string; disabled: boolean }. Event names are case-sensitive.

Event name: sliceToggled. Names are case-sensitive. Read the payload from detail on CustomEvent<{ index: number; sliceId: string; disabled: boolean }>.

javascript
chart.addEventListener('sliceToggled', event => {
  console.log(event.detail); // { index: number; sliceId: string; disabled: boolean }
});

appended

CustomEvent.detail type: { count: number }. Event names are case-sensitive.

Event name: appended. Names are case-sensitive. Read the payload from detail on CustomEvent<{ count: number }>.

javascript
chart.addEventListener('appended', event => {
  console.log(event.detail); // { count: number }
});

windowSlid

CustomEvent.detail type: { dropped: number }. Event names are case-sensitive.

Event name: windowSlid. Names are case-sensitive. Read the payload from detail on CustomEvent<{ dropped: number }>.

javascript
chart.addEventListener('windowSlid', event => {
  console.log(event.detail); // { dropped: number }
});

chartAnimationStart

CustomEvent.detail type: void. Event names are case-sensitive.

Event name: chartAnimationStart. Names are case-sensitive. Read the payload from detail on CustomEvent<void>.

javascript
chart.addEventListener('chartAnimationStart', event => {
  console.log(event.detail); // void
});

chartAnimationEnd

CustomEvent.detail type: void. Event names are case-sensitive.

Event name: chartAnimationEnd. Names are case-sensitive. Read the payload from detail on CustomEvent<void>.

javascript
chart.addEventListener('chartAnimationEnd', event => {
  console.log(event.detail); // void
});

chartAnimationInterrupted

CustomEvent.detail type: void. Event names are case-sensitive.

Event name: chartAnimationInterrupted. Names are case-sensitive. Read the payload from detail on CustomEvent<void>.

javascript
chart.addEventListener('chartAnimationInterrupted', event => {
  console.log(event.detail); // void
});

tooltipShow

Whether to display the built-in tooltip.

Event name: tooltipShow. Names are case-sensitive. Read the payload from detail on CustomEvent<PieChartTooltipShowEventDetail>.

javascript
chart.addEventListener('tooltipShow', event => {
  console.log(event.detail); // PieChartTooltipShowEventDetail
});

tooltipHide

CustomEvent.detail type: void. Event names are case-sensitive.

Event name: tooltipHide. Names are case-sensitive. Read the payload from detail on CustomEvent<void>.

javascript
chart.addEventListener('tooltipHide', event => {
  console.log(event.detail); // void
});

tooltipAction

CustomEvent.detail type: PieChartTooltipActionEventDetail. Event names are case-sensitive.

Event name: tooltipAction. Names are case-sensitive. Read the payload from detail on CustomEvent<PieChartTooltipActionEventDetail>.

javascript
chart.addEventListener('tooltipAction', event => {
  console.log(event.detail); // PieChartTooltipActionEventDetail
});

Methods

redraw

Redraw the chart using its current data and options. Inspect the rendered result after the returned Promise resolves.

typescript
redraw(): Promise<PieChartRenderResult>

Return type: Promise<PieChartRenderResult>. Call the method after element registration and await its Promise result.

getActiveTier

An asynchronous method. Check the argument and return types below.

typescript
getActiveTier(): Promise<PieChartEngineTier>

Return type: Promise<PieChartEngineTier>. Call the method after element registration and await its Promise result.

addSlice

An asynchronous method. Check the argument and return types below.

typescript
addSlice(datum: PieChartDatum, opts?: { insertAt?: number }): Promise<number>
ArgumentsTypeRequired
datumPieChartDatumRequired
opts{ insertAt?: number }Optional

Return type: Promise<number>. Call the method after element registration and await its Promise result.

removeSlice

An asynchronous method. Check the argument and return types below.

typescript
removeSlice(idOrIndex: string | number): Promise<boolean>
ArgumentsTypeRequired
idOrIndexstring | numberRequired

Return type: Promise<boolean>. Call the method after element registration and await its Promise result.

updateSlice

An asynchronous method. Check the argument and return types below.

typescript
updateSlice(idOrIndex: string | number, patch: Partial<Exclude<PieChartDatum, number>>): Promise<boolean>
ArgumentsTypeRequired
idOrIndexstring | numberRequired
patchPartial<Exclude<PieChartDatum, number>>Required

Return type: Promise<boolean>. Call the method after element registration and await its Promise result.

setSliceData

An asynchronous method. Check the argument and return types below.

typescript
setSliceData(idOrIndex: string | number, value: number): Promise<boolean>
ArgumentsTypeRequired
idOrIndexstring | numberRequired
valuenumberRequired

Return type: Promise<boolean>. Call the method after element registration and await its Promise result.

appendPoint

Append one value to the stream. Check the argument type and the licensing requirements for streaming.

typescript
appendPoint(datum: PieChartDatum): Promise<void>
ArgumentsTypeRequired
datumPieChartDatumRequired

Return type: Promise<void>. Call the method after element registration and await its Promise result.

appendBatch

Append multiple values to the stream. Check the argument type and the licensing requirements for streaming.

typescript
appendBatch(datums: ReadonlyArray<PieChartDatum>): Promise<void>
ArgumentsTypeRequired
datumsReadonlyArray<PieChartDatum>Required

Return type: Promise<void>. Call the method after element registration and await its Promise result.

shift

Drop the oldest streamed categories (the data boxes are not the stream).

typescript
shift(count?: number): Promise<void>
ArgumentsTypeRequired
countnumberOptional

Return type: Promise<void>. Call the method after element registration and await its Promise result.

replace

Swap the streamed set (replace([]) clears it); the base values never leave. Without chart.streaming the dies upsert into the base like a batch (quietly: no appended, no binChanged, as a ring replace).

typescript
replace(datums: ReadonlyArray<PieChartDatum>): Promise<void>
ArgumentsTypeRequired
datumsReadonlyArray<PieChartDatum>Required

Return type: Promise<void>. Call the method after element registration and await its Promise result.

getStreamSource

The stream session's source (Chart Pro): like the stream methods it waits for a license still being confirmed.

typescript
getStreamSource(): Promise<PieChartStreamSource | undefined>

Return type: Promise<PieChartStreamSource | undefined>. Call the method after element registration and await its Promise result.

setAnimation

An asynchronous method. Check the argument and return types below.

typescript
setAnimation(options: { duration?: number; easing?: PieChartEasing; enabled?: boolean; type?: PieChartAnimationType }): Promise<void>
ArgumentsTypeRequired
options{ duration?: number; easing?: PieChartEasing; enabled?: boolean; type?: PieChartAnimationType }Required

Return type: Promise<void>. Call the method after element registration and await its Promise result.

pauseAnimation

Pause the current animation.

typescript
pauseAnimation(): Promise<void>

Return type: Promise<void>. Call the method after element registration and await its Promise result.

resumeAnimation

Resume a paused animation.

typescript
resumeAnimation(): Promise<void>

Return type: Promise<void>. Call the method after element registration and await its Promise result.

replayAnimation

Replay the initial sweep-from-zero reveal. No-op when animation is off.

typescript
replayAnimation(): Promise<void>

Return type: Promise<void>. Call the method after element registration and await its Promise result.

selectSlice

Pie-only — select a slice by id or index.

typescript
selectSlice(idOrIndex: string | number, selected?: boolean): Promise<boolean>
ArgumentsTypeRequired
idOrIndexstring | numberRequired
selectedbooleanOptional

Return type: Promise<boolean>. Call the method after element registration and await its Promise result.

deselectSlice

Pie-only — clear selection on a slice.

typescript
deselectSlice(idOrIndex: string | number): Promise<boolean>
ArgumentsTypeRequired
idOrIndexstring | numberRequired

Return type: Promise<boolean>. Call the method after element registration and await its Promise result.

getSelectedSlices

Pie-only — read the current selection set.

typescript
getSelectedSlices(): Promise<string[]>

Return type: Promise<string[]>. Call the method after element registration and await its Promise result.

hitTestSlice

Pie-only — hit-test slice at canvas-relative coordinates.

typescript
hitTestSlice(cssX: number, cssY: number): Promise<{ sliceIndex: number; sliceId: string } | null>
ArgumentsTypeRequired
cssXnumberRequired
cssYnumberRequired

Return type: Promise<{ sliceIndex: number; sliceId: string } | null>. Call the method after element registration and await its Promise result.

showTooltipAtSlice

Pie-only — programmatic tooltip open.

typescript
showTooltipAtSlice(idOrIndex: string | number): Promise<PieChartSliceEventDetail | null>
ArgumentsTypeRequired
idOrIndexstring | numberRequired

Return type: Promise<PieChartSliceEventDetail | null>. Call the method after element registration and await its Promise result.

hideTooltip

Close the currently visible tooltip.

typescript
hideTooltip(): Promise<void>

Return type: Promise<void>. Call the method after element registration and await its Promise result.

getEngineStatus

Requested engine vs what runs, and why (CHART-ADD-08): always Standard (this type has no WebGPU renderer); read without side effects, never consults the license.

typescript
getEngineStatus(): Promise<ChartEngineStatus>

Return type: Promise<ChartEngineStatus>. Call the method after element registration and await its Promise result.