Box Plot.

PRO

Summarize the median and spread with boxes and whiskers.

Live preview21 feature examples

LIVE EXAMPLE

Distribution by process

Match the page theme
Interact with the chart to see selection and range-change results here.
OptionsChanges are reflected in the preview and code.
Appearance and style11
Axes and grid lines14
Legend and interaction13
Title and dimensions3

Calculate the median, quartiles, and whiskers from raw samples. All values are sample data.

View code
Current preview
<div id="chart-container" style="width: 100%; min-width: 0;"></div>

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

  // Pro: complete registerLicense at app startup using your issued certificate.
  // The website preview certificate is not for use in customer apps.
  const specs = [
    {
      "id": "example-chart",
      "tag": "sy-box-plot-chart",
      "props": {
        "data": [
          {
            "category": "Process A",
            "values": [21, 24, 25, 28, 29, 31, 35, 47]
          },
          {
            "category": "Process B",
            "values": [25, 28, 30, 32, 34, 35, 37, 39]
          },
          {
            "category": "Process C",
            "values": [20, 25, 29, 32, 35, 38, 45, 52]
          }
        ],
        "orientation": "vertical",
        "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', 'box-plot example chart');
    return element;
  });
  container.replaceChildren(...elements);
  const chart = elements.at(-1);
  const onEvent = event => {
    console.log('pointClick', event.detail);
  };
  chart.addEventListener('pointClick', 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('pointClick', onEvent);
    container.replaceChildren();
  }
</script>

Usage and data

#

Compare distributions across groups and explore outliers.

Whiskers follow the configured calculation rule. Inspect raw values as well when the sample is small.

Data contract

PropertyInput format
dataPass raw samples as { category, values: [...] } or provide summary statistics.
orientationThe direction in which boxes are drawn.

Updating data

Assign a new array or object to the property instead of mutating values inside an array. Chart events provide selection results through event.detail. When disposing of the view, clean up ResizeObserver and event listeners registered by your app.

Add to your interface

#

The code tabs below the preview contain the full data, options, event bindings, and responsive sizing for the current example. Copy them into an app project, such as Vite, that can resolve the installed packages.

Shared sy-chart API versus direct tags

API reference

#

The full public API for sy-box-plot-chart. Pass objects and arrays as JavaScript properties. Select a name to view usage code and type definitions.

Key properties

Attribute / PropertyType / DefaultDescription
BoxPlotDataDefault: undefinedPass raw samples as { category, values: [...] } or provide summary statistics.
numberDefault: 900Chart width in pixels. Update with ResizeObserver when the container changes.
numberDefault: 360Chart height in pixels.
brandLogostringDefault: undefinedThe default is the Syidax logo. With the Pro chart.branding entitlement, use none or a PNG, JPEG, or WebP data URL.
brandPosition'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'Default: 'bottom-right'The corner where the logo is anchored. Applies equally to Community and Pro, on screen and in image exports.
xAxisXAxisInputDefault: undefinedThe category axis (its `label` / `show` / `format`; the slots are one per box) — the VALUE axis under `orientation="horizontal"`; a slot array adds top / bottom axes (a `linkedTo` slot mirrors the boxes).
yAxisYAxisInputDefault: undefinedThe value axis: one input, or slots (`[left, right]` = the dual y-axis, later slots alternate; `kind: 'log' | 'time'`, `linkedTo`) — the CATEGORY axis under `orientation="horizontal"` (a linked later slot mirrors it).
gridLinesCartesianGridLinesInputDefault: undefinedGrid lines: the value axis's on by default, the category axis's off (a category axis has no continuous grid).
CartesianCrosshairInputDefault: undefinedCrosshair that follows the cursor across the plot.
CartesianZoomInputDefault: undefinedSettings for zooming and the visible range.
BoxPlotOrientationDefault: 'vertical'The direction in which boxes are drawn.
boxFillAlphanumberDefault: DEFAULT_FILL_ALPHASet as an HTML attribute or JavaScript property. type: number.
boxWidthnumberDefault: BOX_DEFAULT_WIDTH_RATIOThe box's share of the slot pitch (0.6), clamped between `box-min-px` and `box-max-px`.
capWidthnumberDefault: BOX_DEFAULT_CAP_RATIOThe whisker caps' share of the box width (0.5; 0 hides them).
whiskerWidthnumberDefault: 1CSS px: the whisker / border thickness, the median thickness, the outlier radius.
medianWidthnumberDefault: 2Set as an HTML attribute or JavaScript property. type: number.
outlierRadiusnumberDefault: 3Set as an HTML attribute or JavaScript property. type: number.
booleanDefault: falseSet as an HTML attribute or JavaScript property. type: boolean.
notchWidthnumberDefault: 0.5Set as an HTML attribute or JavaScript property. type: number.
showMeanbooleanDefault: falseSet as an HTML attribute or JavaScript property. type: boolean.
meanSizenumberDefault: 6Set as an HTML attribute or JavaScript property. type: number.
chartTitlestringDefault: undefinedThe title inside the chart. Explain the data's unit and meaning alongside it.
chartSubtitlestringDefault: undefinedThe subtitle inside the chart.
CartesianTooltipInputDefault: undefinedTooltip settings for pointer-driven values, position, and content.
tooltipEnabledbooleanDefault: trueSet as an HTML attribute or JavaScript property. type: boolean.
animatedbooleanDefault: falseWhether to animate initial display and data changes.
animationDurationnumberDefault: 600Animation duration in milliseconds.
animationEasingBoxPlotEasingDefault: 'ease-out'Allowed values: linear, ease-out, ease-in, ease-in-out. Default: 'ease-out'.
animationTypeBoxPlotAnimationTypeDefault: undefinedAllowed values: initial, update. Default: undefined.
Other properties 20
Attribute / PropertyType / DefaultDescription
yMinnumberDefault: undefinedSet as an HTML attribute or JavaScript property. type: number.
yMaxnumberDefault: undefinedSet as an HTML attribute or JavaScript property. type: number.
numberDefault: 0.05The automatic domain pads the value span by this share (default 5 %).
boxColorstringDefault: DEFAULT_BOX_COLORThe box colour: its border (and, at `box-fill-alpha`, its fill); `auto` whiskers / outliers follow it.
medianColorstringDefault: DEFAULT_MEDIAN_COLORSet as an HTML attribute or JavaScript property. type: string.
whiskerColorstringDefault: 'auto'Set as an HTML attribute or JavaScript property. type: string.
outlierColorstringDefault: 'auto'Set as an HTML attribute or JavaScript property. type: string.
boxMinPxnumberDefault: BOX_DEFAULT_MIN_PXSet as an HTML attribute or JavaScript property. type: number.
boxMaxPxnumberDefault: BOX_DEFAULT_MAX_PXSet as an HTML attribute or JavaScript property. type: number.
meanColorstringDefault: 'auto'Set as an HTML attribute or JavaScript property. type: string.
whiskerRuleBoxPlotWhiskerRule | stringDefault: 'tukey'Pass as a JavaScript property. type: BoxPlotWhiskerRule | string.
quantileMethodBoxPlotQuantileMethod | stringDefault: 'linear'Set as an HTML attribute or JavaScript property. type: BoxPlotQuantileMethod | string.
whiskerPercentilenumberDefault: 5Set as an HTML attribute or JavaScript property. type: number.
enableMouseTrackingbooleanDefault: trueSet as an HTML attribute or JavaScript property. type: boolean.
tooltipFormat(detail: BoxPlotPointEventDetail) => stringDefault: undefinedPass as a JavaScript property. type: (detail: BoxPlotPointEventDetail) => string.
streamSourceBoxPlotStreamSourceDefault: undefinedA stream source for live data. Check the contract for the specific type.
streamMaxnumberDefault: undefinedThe maximum number of streaming data points to retain.
streamWindownumberDefault: undefinedThe streaming data range to keep visible.
BoxPlotEngineModeDefault: 'auto'Renderer selection: auto, standard, or pro. Engine selection is separate from permission to use a Pro chart type.
BoxPlotUnavailableBehaviourDefault: 'fallback'Allowed values: fallback, error. Default: 'fallback'.
Events 14
EventsDetail typeDescription
BoxPlotRenderResult & { tier: BoxPlotEngineTier; engine?: ChartEngineStatus }Emits rendering results in detail when chart drawing completes.
BoxPlotPointEventDetailA point selection event. Read the selected data and index from CustomEvent.detail.
BoxPlotPointEventDetail | nullCustomEvent.detail type: BoxPlotPointEventDetail | null. Event names are case-sensitive.
CartesianCrosshairEventDetail | nullCustomEvent.detail type: CartesianCrosshairEventDetail | null. Event names are case-sensitive.
CartesianZoomChangeEventDetailFired after every zoom change (drag / pan / wheel / pinch / keyboard / api / reset) with the new state.
ChartPointContextMenuEventDetail<BoxPlotPointEventDetail>CustomEvent.detail type: ChartPointContextMenuEventDetail<BoxPlotPointEventDetail>. Event names are case-sensitive.
{ count: number; replaced: number }CustomEvent.detail type: { count: number; replaced: number }. Event names are case-sensitive.
{ dropped: number }CustomEvent.detail type: { dropped: number }. Event names are case-sensitive.
CartesianTooltipEventDetailWhether to display the built-in tooltip.
voidCustomEvent.detail type: void. Event names are case-sensitive.
CartesianTooltipActionEventDetailCustomEvent.detail type: CartesianTooltipActionEventDetail. Event names are case-sensitive.
voidCustomEvent.detail type: void. Event names are case-sensitive.
voidCustomEvent.detail type: void. Event names are case-sensitive.
voidCustomEvent.detail type: void. Event names are case-sensitive.
Methods 33

Stencil methods return Promises. Use await within an async function to read the result.

Method / ArgumentsReturn typeDescription
Promise<ChartDataTable>Current normalized table, including the retained stream; independent of GPU availability.
Promise<BoxPlotRenderResult>Draws a frame now; rejects with the SyidaxLicenseError while the type is not entitled or the chart is frozen.
Promise<BoxPlotEngineTier>An asynchronous method. Check the argument and return types below.
Promise<string | undefined>An asynchronous method. Check the argument and return types below.
data: BoxPlotDataPromise<void>An asynchronous method. Check the argument and return types below.
datum: BoxPlotDatumInputPromise<void>Upsert one category (a tracked category replaces its box).
data: ReadonlyArray<BoxPlotDatumInput>Promise<void>An asynchronous method. Check the argument and return types below.
count: numberPromise<void>Drop the oldest streamed categories (the `data` boxes are not the stream).
data: ReadonlyArray<BoxPlotDatumInput>Promise<void>An asynchronous method. Check the argument and return types below.
Promise<BoxPlotStreamSource | undefined>An asynchronous method. Check the argument and return types below.
options: { duration?: number; easing?: BoxPlotEasing; enabled?: boolean; type?: BoxPlotAnimationType }Promise<void>An asynchronous method. Check the argument and return types below.
Promise<void>An asynchronous method. Check the argument and return types below.
Promise<void>An asynchronous method. Check the argument and return types below.
Promise<void>An asynchronous method. Check the argument and return types below.
cssX: number, cssY: numberPromise<BoxPlotPointEventDetail | null>The box under a host-local CSS point (the nearest slot, within half a pitch), or null.
index: numberPromise<BoxPlotBox | null>An asynchronous method. Check the argument and return types below.
category: stringPromise<BoxPlotBox | null>An asynchronous method. Check the argument and return types below.
Promise<number>An asynchronous method. Check the argument and return types below.
Promise<BoxPlotBox[]>An asynchronous method. Check the argument and return types below.
index: numberPromise<BoxPlotStatistics | null>An asynchronous method. Check the argument and return types below.
Promise<string[]>An asynchronous method. Check the argument and return types below.
Promise<BoxPlotExtent>An asynchronous method. Check the argument and return types below.
Promise<BoxPlotDomain>An asynchronous method. Check the argument and return types below.
index: numberPromise<CartesianTooltipEventDetail | null>An asynchronous method. Check the argument and return types below.
Promise<void>An asynchronous method. Check the argument and return types below.
index: numberPromise<BoxPlotPointEventDetail | null>An asynchronous method. Check the argument and return types below.
request: CartesianZoomRequestPromise<CartesianZoomChangeEventDetail | null>Zoom to explicit windows: `x` / `y` as `{ min, max }` or `[min, max]` (`null` clears that orientation); `xAxis` / `yAxis` name the axis by id or slot index (default: the primary axis).
factor: number, anchorFraction?: numberPromise<CartesianZoomChangeEventDetail | null>Scale the current windows by `factor` (< 1 zooms in) around `anchorFraction` (0..1, default centre).
delta: { x?: number; y?: number }Promise<CartesianZoomChangeEventDetail | null>Slide the zoomed windows by data units (`{ x?, y? }`); a no-op at the full extent.
Promise<CartesianZoomChangeEventDetail | null>Back to the full extent.
Promise<CartesianZoomState | null>The current zoom state (`null` = full extent).
request?: CartesianZoomExtentRequestPromise<CartesianZoomExtentDetail | null>The full extent (and key) of the primary — or the named — axes (`null` before the first layout).
Promise<ChartEngineStatus>Requested engine vs what runs, and why (CHART-ADD-08): the decision for the current inputs, read without side effects (ProChartLicense.engineStatus); a renderer that failed at run time reports engine-unsupported.