Error Bar.
PROShow uncertainty or a range around a central value.
LIVE EXAMPLE
Mean and range
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
<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
| Property | Input format |
|---|---|
data | Use { 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.
View code
Endpoints and center markersPRO
Emphasize the range with wide caps and center markers.
View code
Inspect values with the pointerPRO
Point to data to view the value at that location.
View code
Crosshair trackingPRO
Move the pointer to read horizontal and vertical coordinates alongside values.
View code
Drag to zoom and panPRO
Drag to zoom and hold Shift to pan. Use Ctrl + wheel to zoom in or out.
View code
Replay animationPRO
Redraw the same example to inspect its initial display animation.
View code
AnimationPRO
Compare 1 examples of Animation. Buttons and options update both the live result and source code.
View code
AxisPRO
Compare 6 examples of Axis. Buttons and options update both the live result and source code.
View code
CrosshairPRO
Compare 5 examples of Crosshair. Buttons and options update both the live result and source code.
View code
Data inputPRO
Compare 1 examples of Data input. Buttons and options update both the live result and source code.
View code
Large datasetsPRO
Compare 1 examples of Large datasets. Buttons and options update both the live result and source code.
View code
SizePRO
Compare 1 examples of Size. Buttons and options update both the live result and source code.
View code
TooltipPRO
Compare 13 examples of Tooltip. Buttons and options update both the live result and source code.
View code
Zoom and panPRO
Compare 6 examples of Zoom and pan. Buttons and options update both the live result and source code.
View code
Context menuPRO
Compare 1 examples of Context menu. Buttons and options update both the live result and source code.
View code
Data context menuPRO
Compare 1 examples of Data context menu. Buttons and options update both the live result and source code.
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.
View code
OverviewPRO
Compare 4 examples of Overview. Buttons and options update both the live result and source code.
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.
View code
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.
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 / Property | Type / Default | Description |
|---|---|---|
ErrorBarDataDefault: undefined | Use { category, value, low, high } or a symmetric error. | |
numberDefault: 900 | Chart width in pixels. Update with ResizeObserver when the container changes. | |
numberDefault: 360 | Chart height in pixels. | |
| brandLogo | stringDefault: undefined | The 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. |
| xAxis | XAxisInputDefault: undefined | The 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). |
| yAxis | YAxisInputDefault: undefined | The value axis: one input, or slots (`[left, right]` = the dual y-axis, later slots alternate; `kind: 'log' | 'time'`, `linkedTo`). |
| gridLines | CartesianGridLinesInputDefault: undefined | Grid lines: the value axis's on by default, the category axis's off. |
CartesianCrosshairInputDefault: undefined | Crosshair that follows the cursor across the plot. | |
CartesianZoomInputDefault: undefined | Settings for zooming and the visible range. | |
| errorColor | stringDefault: DEFAULT_ERROR_COLOR | Set as an HTML attribute or JavaScript property. type: string. |
| showBars | booleanDefault: false | Bar mode: a column from zero to the value instead of a marker (the domain joins zero). |
| barWidth | numberDefault: ERROR_BAR_DEFAULT_BAR_RATIO | The column's share of the slot pitch (0.6), clamped between `bar-min-px` and `bar-max-px`. |
| capWidth | numberDefault: ERROR_BAR_DEFAULT_CAP_RATIO | The caps' share of the slot pitch (0.3; clamped 4 … 40 px; 0 hides them), their switch. |
| showCaps | booleanDefault: true | Set as an HTML attribute or JavaScript property. type: boolean. |
| markerSize | numberDefault: ERROR_BAR_DEFAULT_MARKER_PX | The marker's size and the whisker's thickness in CSS px. |
| whiskerWidth | numberDefault: ERROR_BAR_DEFAULT_WHISKER_PX | Set as an HTML attribute or JavaScript property. type: number. |
| chartTitle | stringDefault: undefined | The title inside the chart. Explain the data's unit and meaning alongside it. |
| chartSubtitle | stringDefault: undefined | The subtitle inside the chart. |
CartesianTooltipInputDefault: undefined | Tooltip settings for pointer-driven values, position, and content. | |
| tooltipEnabled | booleanDefault: true | Set as an HTML attribute or JavaScript property. type: boolean. |
| animated | booleanDefault: false | Whether to animate initial display and data changes. |
| animationDuration | numberDefault: 600 | Animation duration in milliseconds. |
| animationEasing | ErrorBarEasingDefault: 'ease-out' | Allowed values: linear, ease-out, ease-in, ease-in-out. Default: 'ease-out'. |
| animationType | ErrorBarAnimationTypeDefault: undefined | Allowed values: initial, update. Default: undefined. |
Other properties 14
| Attribute / Property | Type / Default | Description |
|---|---|---|
| yMin | numberDefault: undefined | Set as an HTML attribute or JavaScript property. type: number. |
| yMax | numberDefault: undefined | Set as an HTML attribute or JavaScript property. type: number. |
numberDefault: 0.05 | The automatic domain pads the span over the bounds by this share (default 5 %); bar mode joins zero. | |
stringDefault: DEFAULT_FILL_COLOR | The marker / column colour, the whisker + cap colour, the hovered / focused point. | |
| activeColor | stringDefault: DEFAULT_ACTIVE_COLOR | Set as an HTML attribute or JavaScript property. type: string. |
| barMinPx | numberDefault: ERROR_BAR_DEFAULT_MIN_PX | Set as an HTML attribute or JavaScript property. type: number. |
| barMaxPx | numberDefault: ERROR_BAR_DEFAULT_MAX_PX | Set as an HTML attribute or JavaScript property. type: number. |
| enableMouseTracking | booleanDefault: true | Set as an HTML attribute or JavaScript property. type: boolean. |
| tooltipFormat | (detail: ErrorBarPointEventDetail) => stringDefault: undefined | Pass as a JavaScript property. type: (detail: ErrorBarPointEventDetail) => string. |
| streamSource | ErrorBarStreamSourceDefault: undefined | A stream source for live data. Check the contract for the specific type. |
| streamMax | numberDefault: undefined | The maximum number of streaming data points to retain. |
| streamWindow | numberDefault: undefined | The 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
| Events | Detail type | Description |
|---|---|---|
ErrorBarRenderResult & { tier: ErrorBarEngineTier; engine?: ChartEngineStatus } | Emits rendering results in detail when chart drawing completes. | |
ErrorBarPointEventDetail | A point selection event. Read the selected data and index from CustomEvent.detail. | |
ErrorBarPointEventDetail | null | CustomEvent.detail type: ErrorBarPointEventDetail | null. Event names are case-sensitive. | |
CartesianCrosshairEventDetail | null | CustomEvent.detail type: CartesianCrosshairEventDetail | null. Event names are case-sensitive. | |
CartesianZoomChangeEventDetail | Fired 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. | |
CartesianTooltipEventDetail | Whether to display the built-in tooltip. | |
void | CustomEvent.detail type: void. Event names are case-sensitive. | |
CartesianTooltipActionEventDetail | CustomEvent.detail type: CartesianTooltipActionEventDetail. Event names are case-sensitive. | |
void | CustomEvent.detail type: void. Event names are case-sensitive. | |
void | CustomEvent.detail type: void. Event names are case-sensitive. | |
void | CustomEvent.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 / Arguments | Return type | Description |
|---|---|---|
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: ErrorBarData | Promise<void> | An asynchronous method. Check the argument and return types below. |
| datum: ErrorBarDatumInput | Promise<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: number | Promise<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: number | Promise<ErrorBarPointEventDetail | null> | The point under a host-local CSS point (the nearest slot, within half a pitch), or null. |
| index: number | Promise<ErrorBarPoint | null> | An asynchronous method. Check the argument and return types below. |
| category: string | Promise<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: number | Promise<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: number | Promise<ErrorBarPointEventDetail | null> | Move the keyboard focus ring to a point (null off the points); emits pointHover like the walk. |
| request: CartesianZoomRequest | Promise<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?: number | Promise<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?: CartesianZoomExtentRequest | Promise<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. |
No matching APIs.