Waterfall.

PRO

Show how increases and decreases accumulate into a final value.

Live preview20 feature examples

LIVE EXAMPLE

Revenue changes

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

Add increases and decreases to the opening value to show the final total. 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-waterfall-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-waterfall-chart",
      "props": {
        "data": [
          {
            "category": "Opening",
            "value": 100
          },
          {
            "category": "New",
            "value": 45
          },
          {
            "category": "Cancellations",
            "value": -20
          },
          {
            "category": "Additions",
            "value": 15
          },
          {
            "category": "Total",
            "kind": "total"
          }
        ],
        "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', 'waterfall 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

#

Explain the opening value, changes, and total for revenue, costs, or inventory.

total and subtotal differ from ordinary changes. Do not add a total again as a delta.

Data contract

PropertyInput format
dataAn array of { category, value?, kind? }. kind is delta, subtotal, or total.

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-waterfall-chart. Pass objects and arrays as JavaScript properties. Select a name to view usage code and type definitions.

Key properties

Attribute / PropertyType / DefaultDescription
WaterfallDataDefault: undefinedAn array of { category, value?, kind? }. kind is delta, subtotal, or total.
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 bar), or `[bottom, top, …]` slots (the multi x-axis: every slot a category axis over the bars — `position`, `linkedTo`, `format` per the shared contract).
yAxisYAxisInputDefault: undefinedThe value axis: one input, or `[left, right, …]` slots (the dual / multi y-axis; `kind: 'log' | 'time'` and `linkedTo` per the shared contract).
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.
upColorstringDefault: DEFAULT_UP_COLORThe bar colours: a rising delta, a falling delta, a total / subtotal; the connectors; the hovered / focused bar.
downColorstringDefault: DEFAULT_DOWN_COLORSet as an HTML attribute or JavaScript property. type: string.
totalColorstringDefault: DEFAULT_TOTAL_COLORSet as an HTML attribute or JavaScript property. type: string.
connectorWidthnumberDefault: 1The connector's thickness in CSS px, and its switch.
showConnectorsbooleanDefault: trueSet as an HTML attribute or JavaScript property. type: boolean.
showTotalbooleanDefault: falseSet as an HTML attribute or JavaScript property. type: boolean.
totalLabelstringDefault: WATERFALL_DEFAULT_TOTAL_LABELSet as an HTML attribute or JavaScript property. type: string.
showLabelsbooleanDefault: falseThe value labels (off by default): `label-mode` value (a delta's signed change, a total's running total) / running / both; `labelFormat(bar)` replaces the text.
labelModeWaterfallLabelModeDefault: 'value'Allowed values: value, running, both. Default: 'value'.
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.
animationEasingWaterfallEasingDefault: 'ease-out'Allowed values: linear, ease-out, ease-in, ease-in-out. Default: 'ease-out'.
animationTypeWaterfallAnimationTypeDefault: undefinedAllowed values: initial, update. Default: undefined.
Other properties 18
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 %); zero is always inside.
connectorColorstringDefault: DEFAULT_CONNECTOR_COLORSet as an HTML attribute or JavaScript property. type: string.
activeColorstringDefault: DEFAULT_ACTIVE_COLORSet as an HTML attribute or JavaScript property. type: string.
barWidthnumberDefault: WATERFALL_DEFAULT_WIDTH_RATIOThe bar's share of the slot pitch (0.6), clamped between `bar-min-px` and `bar-max-px`.
barMinPxnumberDefault: WATERFALL_DEFAULT_MIN_PXSet as an HTML attribute or JavaScript property. type: number.
barMaxPxnumberDefault: WATERFALL_DEFAULT_MAX_PXSet as an HTML attribute or JavaScript property. type: number.
detectResultbooleanDefault: trueRecognise a last step given as a plain value equal to the running total as the RESULT bar (a total from zero; `detected: true`); off → it stays a delta.
lastResultbooleanDefault: undefinedTrue: the last merged step is a result spanning zero and the preceding running total, ignoring its value/colour. False: disable detection, preserving explicit datum kinds. Omitted: use detect-result.
labelFormat(bar: WaterfallBar) => stringDefault: undefinedPass as a JavaScript property. type: (bar: WaterfallBar) => string.
enableMouseTrackingbooleanDefault: trueSet as an HTML attribute or JavaScript property. type: boolean.
tooltipFormat(detail: WaterfallPointEventDetail) => stringDefault: undefinedPass as a JavaScript property. type: (detail: WaterfallPointEventDetail) => string.
streamSourceWaterfallStreamSourceDefault: 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.
WaterfallEngineModeDefault: 'auto'Renderer selection: auto, standard, or pro. Engine selection is separate from permission to use a Pro chart type.
WaterfallUnavailableBehaviourDefault: 'fallback'Allowed values: fallback, error. Default: 'fallback'.
Events 14
EventsDetail typeDescription
WaterfallRenderResult & { tier: WaterfallEngineTier; engine?: ChartEngineStatus }Emits rendering results in detail when chart drawing completes.
WaterfallPointEventDetailA point selection event. Read the selected data and index from CustomEvent.detail.
WaterfallPointEventDetail | nullCustomEvent.detail type: WaterfallPointEventDetail | null. Event names are case-sensitive.
CartesianCrosshairEventDetail | nullCustomEvent.detail type: CartesianCrosshairEventDetail | null. Event names are case-sensitive.
ChartPointContextMenuEventDetail<WaterfallPointEventDetail>CustomEvent.detail type: ChartPointContextMenuEventDetail<WaterfallPointEventDetail>. 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.
CartesianZoomChangeEventDetailFired after every zoom change (drag / pan / wheel / pinch / keyboard / api / reset) with the new state.
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<WaterfallRenderResult>Draws a frame now; rejects with the SyidaxLicenseError while the type is not entitled or the chart is frozen.
Promise<WaterfallEngineTier>An asynchronous method. Check the argument and return types below.
Promise<string | undefined>An asynchronous method. Check the argument and return types below.
data: WaterfallDataPromise<void>An asynchronous method. Check the argument and return types below.
datum: WaterfallDatumInputPromise<void>Upsert one step (a tracked category replaces its step; the running total re-tells).
data: ReadonlyArray<WaterfallDatumInput>Promise<void>An asynchronous method. Check the argument and return types below.
count: numberPromise<void>Drop the oldest streamed steps (the `data` bars are not the stream).
data: ReadonlyArray<WaterfallDatumInput>Promise<void>An asynchronous method. Check the argument and return types below.
Promise<WaterfallStreamSource | undefined>An asynchronous method. Check the argument and return types below.
options: { duration?: number; easing?: WaterfallEasing; enabled?: boolean; type?: WaterfallAnimationType }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<WaterfallPointEventDetail | null>The bar under a host-local CSS point (the nearest slot, within half a pitch), or null.
index: numberPromise<WaterfallBar | null>An asynchronous method. Check the argument and return types below.
category: stringPromise<WaterfallBar | null>An asynchronous method. Check the argument and return types below.
Promise<number>An asynchronous method. Check the argument and return types below.
Promise<WaterfallBar[]>An asynchronous method. Check the argument and return types below.
Promise<string[]>An asynchronous method. Check the argument and return types below.
Promise<WaterfallExtent>An asynchronous method. Check the argument and return types below.
Promise<WaterfallDomain>An asynchronous method. Check the argument and return types below.
Promise<number>The running total after the last bar (0 without bars).
index: numberPromise<CartesianTooltipEventDetail | null>Open the tooltip on a bar (the facade's `showTooltipAtPoint` routes here); null off the bars or with the tooltip off.
Promise<void>Close every tooltip.
index: numberPromise<WaterfallPointEventDetail | null>Move the keyboard focus ring to a bar (null off the bars); 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; x is in slots — bar i sits at i); `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? }` — x in slots); 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 — master axes (x: the slot range −0.5 … n − 0.5).
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.