Dot Plot.

COMMUNITY

Compare multiple measurements per category using dots.

Live preview23 feature examples

LIVE EXAMPLE

Measurements by group

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 style3
Axes and grid lines5
Legend and interaction14
Title and dimensions3

Show multiple values for each item on a shared horizontal scale. 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/components/sy-dot-plot-chart.js';
  define0();

  const specs = [
    {
      "id": "example-chart",
      "tag": "sy-dot-plot-chart",
      "props": {
        "engine": "standard",
        "groups": ["Reference", "Target", "Actual"],
        "legend": true,
        "data": [
          {
            "category": "A",
            "values": [25, 45, 62]
          },
          {
            "category": "B",
            "values": [38, 55, 70]
          },
          {
            "category": "C",
            "values": [30, 50, 82]
          }
        ],
        "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', 'dot-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

#

Use to read differences between groups on the same scale.

Dots overlap at identical positions. Limit the number of groups and explain the colors and legend.

Data contract

PropertyInput format
dataAn array of { category, values: [...] }. Each index represents the same group.
groupsGroup names corresponding to values indices. Match the group count to each values array's length.

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

Key properties

Attribute / PropertyType / DefaultDescription
ReadonlyArray<DotPlotDatum>Default: []An array of { category, values: [...] }. Each index represents the same group.
ReadonlyArray<string>Default: []Group names corresponding to values indices. Match the group count to each values array's length.
numberDefault: 640Chart width in pixels. Update with ResizeObserver when the container changes.
numberDefault: 380Chart 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.
markerSizenumberDefault: 6Marker radius in CSS px.
showRowLinesbooleanDefault: trueDraw a faint guide line across each row between its min and max dot.
sortDescendingbooleanDefault: falseSort categories by the first series' value, largest first.
xLabelMode'auto' | 'all' | 'thin' | 'rotate' | 'none'Default: undefinedHow crowded category-axis (Y/row) labels are decluttered. Default 'auto' thins labels horizontally.
xLabelRotationnumberDefault: undefinedExplicit category-label rotation in degrees (respected as a floor).
valueAxisLabelstringDefault: undefinedSet as an HTML attribute or JavaScript property. type: string.
gridLinesCartesianGridLinesInputDefault: undefinedAllowed values: auto, off. Default: undefined.
CartesianCrosshairInputDefault: undefinedCrosshair that follows the cursor across the plot. `true`/`'auto'` enables a snapping line; pass an object to set mode/snap/color/dash.
chartTitlestringDefault: undefinedThe title inside the chart. Explain the data's unit and meaning alongside it.
chartSubtitlestringDefault: undefinedThe subtitle inside the chart.
booleanDefault: trueWhether to show a legend for series or items.
legendPositionDotPlotChartLegendPositionDefault: 'top'Where the legend is positioned.
tooltipEnabledbooleanDefault: trueSet as an HTML attribute or JavaScript property. type: boolean.
CartesianTooltipInputDefault: undefinedTooltip settings for pointer-driven values, position, and content.
animatedbooleanDefault: falseWhether to animate initial display and data changes.
animationDurationnumberDefault: 600Animation duration in milliseconds.
animationEasingDotPlotChartEasingDefault: 'ease-out'Allowed values: linear, ease-out, ease-in, ease-in-out. Default: 'ease-out'.
animationTypeDotPlotChartAnimationTypeDefault: undefinedAllowed values: initial, update. Default: undefined.
Other properties 12
Attribute / PropertyType / DefaultDescription
ReadonlyArray<string>Default: undefinedOptional override for category (row) labels; else derived from `data`.
string | ReadonlyArray<string>Default: ''Group colour(s). Polymorphic: a single CSS colour, an array of colours, or a comma-separated string. Resolved once per render to one colour per group (`['#94a3b8', '#2563eb']` defaults, then the tableau palette). A datum's own `colors[gi]` overrides the resolved group colour for that dot.
DotPlotMarkerSymbol | string | ReadonlyArray<string>Default: 'circle'Marker glyph(s). Polymorphic exactly like `color`: a single symbol, an array of symbols, or a comma-separated string. Resolved once per render to one marker per group (`['circle', ...]` default). A datum's own `markers[gi]` overrides the resolved group marker for that dot.
xLabelMaxCountnumberDefault: undefinedHard cap on the number of category labels shown.
tooltipFormat(detail: DotPlotChartPointerEventDetail) => stringDefault: undefinedPass as a JavaScript property. type: (detail: DotPlotChartPointerEventDetail) => string.
enableMouseTrackingbooleanDefault: trueSet as an HTML attribute or JavaScript property. type: boolean.
streamSourceDotPlotChartStreamSourceDefault: undefinedA stream source for live data. Check the contract for the specific type.
streamWindownumberDefault: undefinedThe streaming data range to keep visible.
streamMaxnumberDefault: undefinedThe maximum number of streaming data points to retain.
DotPlotChartEngineModeDefault: 'auto'Renderer selection: auto, standard, or pro. Engine selection is separate from permission to use a Pro chart type.
proThresholdnumberDefault: 50_000Set as an HTML attribute or JavaScript property. type: number.
DotPlotChartUnavailableBehaviourDefault: 'fallback'Allowed values: fallback, error, throw. Default: 'fallback'.
Events 16
EventsDetail typeDescription
DotPlotChartRenderResult & { tier: DotPlotChartEngineTier }Emits rendering results in detail when chart drawing completes.
DotPlotChartPointerEventDetailA point selection event. Read the selected data and index from CustomEvent.detail.
DotPlotChartPointerEventDetail | nullCustomEvent.detail type: DotPlotChartPointerEventDetail | null. Event names are case-sensitive.
CartesianCrosshairEventDetail | nullCustomEvent.detail type: CartesianCrosshairEventDetail | null. 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.
CartesianSeriesOutsideClickEventDetailCustomEvent.detail type: CartesianSeriesOutsideClickEventDetail. Event names are case-sensitive.
ChartPointContextMenuEventDetail<DotPlotChartPointerEventDetail>CustomEvent.detail type: ChartPointContextMenuEventDetail<DotPlotChartPointerEventDetail>. Event names are case-sensitive.
DotPlotChartLegendItemEventDetailCustomEvent.detail type: DotPlotChartLegendItemEventDetail. Event names are case-sensitive.
DotPlotChartSeriesToggledEventDetailCustomEvent.detail type: DotPlotChartSeriesToggledEventDetail. Event names are case-sensitive.
{ count: number }CustomEvent.detail type: { count: number }. Event names are case-sensitive.
{ dropped: number }CustomEvent.detail type: { dropped: number }. 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 18

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

Method / ArgumentsReturn typeDescription
Promise<DotPlotChartRenderResult>An asynchronous method. Check the argument and return types below.
Promise<DotPlotChartEngineTier>An asynchronous method. Check the argument and return types below.
data: ReadonlyArray<DotPlotDatum>Promise<void>An asynchronous method. Check the argument and return types below.
datum: DotPlotDatumPromise<void>An asynchronous method. Check the argument and return types below.
data: ReadonlyArray<DotPlotDatum>Promise<void>An asynchronous method. Check the argument and return types below.
count: numberPromise<void>An asynchronous method. Check the argument and return types below.
data: ReadonlyArray<DotPlotDatum>Promise<void>An asynchronous method. Check the argument and return types below.
Promise<DotPlotChartStreamSource | undefined>An asynchronous method. Check the argument and return types below.
options: { duration?: number; easing?: DotPlotChartEasing; enabled?: boolean; type?: DotPlotChartAnimationType }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<DotPlotChartPointerEventDetail | null>An asynchronous method. Check the argument and return types below.
pointIndex: number, seriesIndex?: numberPromise<CartesianTooltipEventDetail | null>Open the tooltip for a dot programmatically. `pointIndex` is the category (row) index; the optional `seriesIndex` selects a group within that row (defaults to the first visible group's dot in the row). Returns the emitted tooltip detail, or null when no dot resolves / the tooltip is disabled.
Promise<void>An asynchronous method. Check the argument and return types below.
id: string | number, opts?: { redraw?: boolean }Promise<boolean>An asynchronous method. Check the argument and return types below.
id: string | number, opts?: { redraw?: boolean }Promise<boolean>An asynchronous method. Check the argument and return types below.
Promise<ChartEngineStatus>Requested engine vs what runs, and why (CHART-ADD-08): always Standard (this type has no WebGPU renderer); read without side effects, never consults the license.