Pareto.

COMMUNITY

Identify major causes using counts and cumulative percentages.

Live preview24 feature examples

LIVE EXAMPLE

Defect causes

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 lines17
Legend and interaction14
Title and dimensions3

Find priorities using counts and cumulative percentages by cause. 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-pareto-chart.js';
  define0();

  const specs = [
    {
      "id": "example-chart",
      "tag": "sy-pareto-chart",
      "props": {
        "engine": "standard",
        "values": [45, 28, 15, 8, 4],
        "categories": ["Scratches", "Contamination", "Sort", "Bonding", "Other"],
        "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', 'pareto 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

#

Explore defect or support-request causes in priority order.

Frequency and severity differ. Assess infrequent, high-risk causes separately.

Data contract

PropertyInput format
valuesOccurrence counts for each category.
categoriesCause names at the same indices as the values.

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

Key properties

Attribute / PropertyType / DefaultDescription
ParetoChartValuesDefault: new Float32Array(0)Occurrence counts for each category.
ReadonlyArray<string>Default: undefinedCause names at the same indices as the values.
numberDefault: 640Chart 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.
lineWidthnumberDefault: 2Cumulative-line width in CSS px.
'circle' | 'square' | 'diamond' | 'none'Default: 'circle'Endpoint marker symbol on the cumulative line. `none` hides markers.
markerSizenumberDefault: 3.5Marker radius in CSS px.
barPaddingnumberDefault: 0.2Gap between adjacent bars as a fraction of the band width (0..1).
sortDescendingbooleanDefault: trueSort categories by value, largest first (classic Pareto ordering).
referenceValuenumberDefault: 8080/20 reference percentage drawn as a horizontal line on the cumulative axis.
showReferencebooleanDefault: trueShow the reference line.
valueAxisLabelstringDefault: undefinedLeft value-axis label.
xAxisCartesianAxisInput | ReadonlyArray<CartesianAxisInput>Default: undefinedAdvanced: x-axis spec override (category axis).
xLabelMode'auto' | 'all' | 'thin' | 'rotate' | 'none'Default: undefinedHow crowded category-axis labels are decluttered. Default 'auto' thins labels horizontally.
xLabelRotationnumberDefault: undefinedExplicit category-label rotation in degrees (respected as a floor).
yAxisCartesianYAxisInputDefault: undefinedAdvanced: left value y-axis spec override.
gridLinesCartesianGridLinesInputDefault: undefinedAllowed values: auto, off. Default: undefined.
CartesianCrosshairInputDefault: undefinedCrosshair that follows the cursor across the plot. `true`/`'auto'` enables a snapping vertical 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.
tooltipEnabledbooleanDefault: trueSet as an HTML attribute or JavaScript property. type: boolean.
CartesianTooltipInputDefault: undefinedTooltip settings for pointer-driven values, position, and content.
booleanDefault: falseWhether to show a legend for series or items.
legendPositionParetoChartLegendPositionDefault: 'bottom'Where the legend is positioned.
animatedbooleanDefault: falseWhether to animate initial display and data changes.
animationDurationnumberDefault: 700Animation duration in milliseconds.
animationEasingParetoChartEasingDefault: 'ease-out'Allowed values: linear, ease-out, ease-in, ease-in-out. Default: 'ease-out'.
animationTypeParetoChartAnimationTypeDefault: undefinedAllowed values: initial, update. Default: undefined.
Other properties 14
Attribute / PropertyType / DefaultDescription
string | ReadonlyArray<string>Default: '#2563eb'Bar fill colour. Accepts a single CSS colour, an array, or a comma-separated string (the first colour is used).
lineColorstringDefault: '#ef4444'Cumulative-line colour.
numberDefault: 0Value the bars grow from. Default 0.
referenceColorstringDefault: '#94a3b8'Reference-line colour.
cumulativeAxisLabelstringDefault: undefinedRight cumulative-axis label.
xLabelMaxCountnumberDefault: undefinedHard cap on the number of category labels shown.
tooltipFormat(detail: ParetoChartPointerEventDetail) => stringDefault: undefinedPass as a JavaScript property. type: (detail: ParetoChartPointerEventDetail) => string.
enableMouseTrackingbooleanDefault: trueSet as an HTML attribute or JavaScript property. type: boolean.
streamSourceParetoChartStreamSourceDefault: 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.
ParetoChartEngineModeDefault: '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.
ParetoChartUnavailableBehaviourDefault: 'fallback'Allowed values: fallback, error, throw. Default: 'fallback'.
Events 16
EventsDetail typeDescription
ParetoChartRenderResult & { tier: ParetoChartEngineTier }Emits rendering results in detail when chart drawing completes.
ParetoChartPointerEventDetailA point selection event. Read the selected data and index from CustomEvent.detail.
ParetoChartPointerEventDetail | nullCustomEvent.detail type: ParetoChartPointerEventDetail | 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<ParetoChartPointerEventDetail>CustomEvent.detail type: ChartPointContextMenuEventDetail<ParetoChartPointerEventDetail>. Event names are case-sensitive.
ParetoChartLegendItemEventDetailCustomEvent.detail type: ParetoChartLegendItemEventDetail. Event names are case-sensitive.
{ index: number; seriesId: string; disabled: boolean }CustomEvent.detail type: { index: number; seriesId: string; disabled: boolean }. 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 16

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

Method / ArgumentsReturn typeDescription
Promise<ParetoChartRenderResult>An asynchronous method. Check the argument and return types below.
Promise<ParetoChartEngineTier>An asynchronous method. Check the argument and return types below.
values: ParetoChartValuesPromise<void>An asynchronous method. Check the argument and return types below.
datum: ParetoBarDatum | numberPromise<void>An asynchronous method. Check the argument and return types below.
data: ReadonlyArray<ParetoBarDatum | number>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<ParetoBarDatum | number>Promise<void>An asynchronous method. Check the argument and return types below.
Promise<ParetoChartStreamSource | undefined>An asynchronous method. Check the argument and return types below.
options: { duration?: number; easing?: ParetoChartEasing; enabled?: boolean; type?: ParetoChartAnimationType }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<ParetoChartPointerEventDetail | null>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.
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.