Brickslab.Toolsv2.1.1

@brickslab./ui-webAnalytics

Horizontal bar chart with single bar, stacked series, and histogram modes.

Bar

Strongly agree
320
Agree
480
Neutral
210
Disagree
140
Strongly disagree
80

Stacked with legend

Q1
400
Q2
380
Q3
450
Developer
Designer
PM

Normalized

Strongly agree
320
Agree
480
Neutral
210
Disagree
140
Strongly disagree
80

Props

PropTypeDéfautRequisDescription
dataDistributionDataPoint[]Array of { label, value, series? }.
type"bar" | "stack" | "hist""bar"Chart style.
normalizebooleanfalseAll bars fill 100% width (relative comparison).
showLegendbooleanfalseRenders a series legend below the chart.
Override rapide

Tous les paramètres listés dans cette table sont overrideables via les props. Utilisez ce squelette comme point de départ.

<MyComponent
  data={[]}
  type="bar"
  normalize={false}
  showLegend={false}
/>
datatypenormalizeshowLegend

Usage

tsx
import { DistributionChart } from "@brickslab./ui-web";

<DistributionChart
  data={[
    { label: "Agree", value: 480 },
    { label: "Neutral", value: 210 },
    { label: "Disagree", value: 140 },
  ]}
  type="bar"
/>