Skip to examples
Browse analysis capabilities

Statistical references / ANNOTATION GUIDE

centroid

Compute a scatter center; the cross marks a calculated position rather than an observed point.

01 / EXPLORE

See it in action.

Compare parameter variations. Switch to Code to copy an example with the active theme.

Arithmetic center · Scatter Chart

Weighted center · Scatter Chart

02 / CONFIGURE

Make it yours.

Add this configuration to the annotations array in your chart JSON.

Configuration

PropertyTypeRequiredDefaultDescription
type'centroid'required—Exact annotation type; keep the spelling and capitalization shown here.
dataSelectionoptional—Limit calculations to matching original observations; omit to use all input data.
weightkeyof T & stringoptional—Original data field containing observation weights.
pulsebooleanoptionalfalseAnimate the marker halo; respects reduced-motion preferences.
labelstringoptional—Override the computed label; use an empty string to hide it.
styleAnnotationStyle<'centroid'>optional—Reuse the shared style definition with the fields supported by this annotation type.

03 / CHART SUPPORT

Choose a supported chart.

One example for each supported chart type. The default chart is shown above; the remaining charts use the same annotation configuration.

Calculation rules & limits

  • Scatter only. The cross marks a calculated coordinate, which may not be an observed point.
  • Weights must be finite and nonnegative, with a positive total. Omit weight for the arithmetic center.
Full configuration reference

Example theme

Shared with Theme Studio. Applies to chart and annotation examples.

Default theme

Preset theme

theme.json
{
  "id": "default",
  "label": "Default theme",
  "baseTheme": "default"
}

Copied examples include this theme. Your selection is saved in this browser.