パレート図ParetoChartExperimental

Pareto chart: descending value bars (HTML/CSS, left value axis) overlaid with a cumulative-% line (SVG) on a right 0–100% axis and a 'vital few' threshold line (80% by default), with focusable points and an accessible per-category summary. For defect / downtime / cause analysis and any 'which few drive most of the total' breakdown.

プレビュー

Props

表は横にスクロールできます
プロパティ初期値説明
data{ label?: ReactNode; value: number; color?: ChartColor }[]-Categories with their count / minutes / cost. Sorted descending by default.
thresholdnumber | null80Cumulative-axis reference line in percent — the Pareto 'vital few' cutoff. null hides it.
thresholdLabelReactNode-Label for the threshold line. Defaults to "<threshold>%".
sortbooleantrueSort the data descending by value before plotting (the Pareto convention). false keeps the given order.
formatValue(value: number) => ReactNode-Format the bar values (counts / minutes).
formatPercent(percent: number) => ReactNoden%Format the cumulative percentage.
showValuesbooleanfalseRender the value above each bar.
showLegendbooleantrueShow the bars / cumulative / threshold legend.
cumulativeLabelReactNode"Cumulative"Legend / tooltip label for the cumulative line.
labelReactNode-Accessible name for the chart (also the bars' legend label).
classNamestring-Additional CSS class names.

Usage

import { ParetoChart } from "@gunjo/ui"

// descending bars + cumulative-% line + 80% "vital few" threshold
<ParetoChart
  label="停止時間(分)"
  cumulativeLabel="累計"
  threshold={80}
  formatValue={(v) => `${v}分`}
  showValues
  data={[
    { label: "チョコ停", value: 142 },
    { label: "段取替え", value: 96 },
    { label: "故障", value: 64, color: "destructive" },
    { label: "材料待ち", value: 38 },
    { label: "品質調整", value: 22 },
    { label: "その他", value: 11, color: "muted" },
  ]}
/>