Error Bar.

PRO

Show uncertainty or a range around a central value.

Live preview19 feature examples

LIVE EXAMPLE

Mean and range

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 style7
Axes and grid lines14
Legend and interaction13
Title and dimensions3

Show a central value together with lower and upper bounds. 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-error-bar-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-error-bar-chart",
      "props": {
        "data": [
          {
            "category": "A",
            "value": 40,
            "low": 32,
            "high": 48
          },
          {
            "category": "B",
            "value": 55,
            "low": 50,
            "high": 63
          },
          {
            "category": "C",
            "value": 47,
            "low": 38,
            "high": 54
          }
        ],
        "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', 'error-bar 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

#

Represent means with confidence intervals, tolerances, or measurement ranges.

Error bars do not determine their own meaning. Explain whether they represent standard deviation, a confidence interval, or another range.

Data contract

PropertyInput format
dataUse { category, value, low, high } or a symmetric error.

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.

Feature examples

#

Try 19 interactive feature examples and inspect their code. Select “Edit in preview” to combine more options in the settings panel above.

Value bars and errorsPRO

Show central values as bars and uncertainty as whiskers.

Interact with the chart to see results here.
View code

Endpoints and center markersPRO

Emphasize the range with wide caps and center markers.

Interact with the chart to see results here.
View code

Inspect values with the pointerPRO

Point to data to view the value at that location.

Interact with the chart to see results here.
View code

Crosshair trackingPRO

Move the pointer to read horizontal and vertical coordinates alongside values.

Interact with the chart to see results here.
View code

Drag to zoom and panPRO

Drag to zoom and hold Shift to pan. Use Ctrl + wheel to zoom in or out.

Interact with the chart to see results here.
View code

Replay animationPRO

Redraw the same example to inspect its initial display animation.

Interact with the chart to see results here.
View code

AnimationPRO

Compare 1 examples of Animation. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

AxisPRO

Compare 6 examples of Axis. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

CrosshairPRO

Compare 5 examples of Crosshair. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Data inputPRO

Compare 1 examples of Data input. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Large datasetsPRO

Compare 1 examples of Large datasets. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

SizePRO

Compare 1 examples of Size. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

TooltipPRO

Compare 13 examples of Tooltip. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Zoom and panPRO

Compare 6 examples of Zoom and pan. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Context menuPRO

Compare 1 examples of Context menu. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Data context menuPRO

Compare 1 examples of Data context menu. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Read coordinates and dataPRO

Compare 1 examples of Read coordinates and data. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

OverviewPRO

Compare 4 examples of Overview. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

Streaming · Add and update live dataPRO

Compare 5 examples of Add and update live data. Buttons and options update both the live result and source code.

Interact with the chart to see results here.
View code

API reference

#

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

Key properties

Attribute / PropertyType / DefaultDescription
ErrorBarDataDefault: undefinedUse { category, value, low, high } or a symmetric error.
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 point); a slot array adds top / bottom axes (a `linkedTo` slot mirrors the points).
yAxisYAxisInputDefault: undefinedThe value axis: one input, or slots (`[left, right]` = the dual y-axis, later slots alternate; `kind: 'log' | 'time'`, `linkedTo`).
gridLinesCartesianGridLinesInputDefault: undefinedGrid lines: the value axis's on by default, the category axis's off.
CartesianCrosshairInputDefault: undefinedCrosshair that follows the cursor across the plot.
CartesianZoomInputDefault: undefinedSettings for zooming and the visible range.
errorColorstringDefault: DEFAULT_ERROR_COLORSet as an HTML attribute or JavaScript property. type: string.
showBarsbooleanDefault: falseBar mode: a column from zero to the value instead of a marker (the domain joins zero).
barWidthnumberDefault: ERROR_BAR_DEFAULT_BAR_RATIOThe column's share of the slot pitch (0.6), clamped between `bar-min-px` and `bar-max-px`.
capWidthnumberDefault: ERROR_BAR_DEFAULT_CAP_RATIOThe caps' share of the slot pitch (0.3; clamped 4 … 40 px; 0 hides them), their switch.
showCapsbooleanDefault: trueSet as an HTML attribute or JavaScript property. type: boolean.
markerSizenumberDefault: ERROR_BAR_DEFAULT_MARKER_PXThe marker's size and the whisker's thickness in CSS px.
whiskerWidthnumberDefault: ERROR_BAR_DEFAULT_WHISKER_PXSet 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.
animationEasingErrorBarEasingDefault: 'ease-out'Allowed values: linear, ease-out, ease-in, ease-in-out. Default: 'ease-out'.
animationTypeErrorBarAnimationTypeDefault: undefinedAllowed values: initial, update. Default: undefined.
Other properties 14
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 span over the bounds by this share (default 5 %); bar mode joins zero.
stringDefault: DEFAULT_FILL_COLORThe marker / column colour, the whisker + cap colour, the hovered / focused point.
activeColorstringDefault: DEFAULT_ACTIVE_COLORSet as an HTML attribute or JavaScript property. type: string.
barMinPxnumberDefault: ERROR_BAR_DEFAULT_MIN_PXSet as an HTML attribute or JavaScript property. type: number.
barMaxPxnumberDefault: ERROR_BAR_DEFAULT_MAX_PXSet as an HTML attribute or JavaScript property. type: number.
enableMouseTrackingbooleanDefault: trueSet as an HTML attribute or JavaScript property. type: boolean.
tooltipFormat(detail: ErrorBarPointEventDetail) => stringDefault: undefinedPass as a JavaScript property. type: (detail: ErrorBarPointEventDetail) => string.
streamSourceErrorBarStreamSourceDefault: 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.
ErrorBarEngineModeDefault: 'auto'Renderer selection: auto, standard, or pro. Engine selection is separate from permission to use a Pro chart type.
ErrorBarUnavailableBehaviourDefault: 'fallback'Allowed values: fallback, error. Default: 'fallback'.
Events 14
EventsDetail typeDescription
ErrorBarRenderResult & { tier: ErrorBarEngineTier; engine?: ChartEngineStatus }Emits rendering results in detail when chart drawing completes.
ErrorBarPointEventDetailA point selection event. Read the selected data and index from CustomEvent.detail.
ErrorBarPointEventDetail | nullCustomEvent.detail type: ErrorBarPointEventDetail | 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<ErrorBarPointEventDetail>CustomEvent.detail type: ChartPointContextMenuEventDetail<ErrorBarPointEventDetail>. 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 32

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<ErrorBarRenderResult>Draws a frame now; rejects with the SyidaxLicenseError while the type is not entitled or the chart is frozen.
Promise<ErrorBarEngineTier>An asynchronous method. Check the argument and return types below.
Promise<string | undefined>An asynchronous method. Check the argument and return types below.
data: ErrorBarDataPromise<void>An asynchronous method. Check the argument and return types below.
datum: ErrorBarDatumInputPromise<void>Upsert one point (a tracked category replaces its point).
data: ReadonlyArray<ErrorBarDatumInput>Promise<void>An asynchronous method. Check the argument and return types below.
count: numberPromise<void>Drop the oldest streamed points (the `data` points are not the stream).
data: ReadonlyArray<ErrorBarDatumInput>Promise<void>An asynchronous method. Check the argument and return types below.
Promise<ErrorBarStreamSource | undefined>An asynchronous method. Check the argument and return types below.
options: { duration?: number; easing?: ErrorBarEasing; enabled?: boolean; type?: ErrorBarAnimationType }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<ErrorBarPointEventDetail | null>The point under a host-local CSS point (the nearest slot, within half a pitch), or null.
index: numberPromise<ErrorBarPoint | null>An asynchronous method. Check the argument and return types below.
category: stringPromise<ErrorBarPoint | null>An asynchronous method. Check the argument and return types below.
Promise<number>An asynchronous method. Check the argument and return types below.
Promise<ErrorBarPoint[]>An asynchronous method. Check the argument and return types below.
Promise<string[]>An asynchronous method. Check the argument and return types below.
Promise<ErrorBarExtent>An asynchronous method. Check the argument and return types below.
Promise<ErrorBarDomain>An asynchronous method. Check the argument and return types below.
index: numberPromise<CartesianTooltipEventDetail | null>Open the tooltip on a point (the facade's `showTooltipAtPoint` routes here); null off the points or with the tooltip off.
Promise<void>Close every tooltip.
index: numberPromise<ErrorBarPointEventDetail | null>Move the keyboard focus ring to a point (null off the points); emits pointHover like the walk.
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.