Skip to content

BarDepth

Examples

Jan
Feb
Mar
Apr
May
Jun

API Reference

Types come from the public API. A dash indicates no default is documented here.

BarChart props

Public source
PropTypeDefaultDescription
props.layers
Show type
readonly ({ readonly kind: "weekends"; readonly props: { readonly pattern?: "accent" | "grid" | "none" | "horizontal" | "vertical" | "vertical-dense" | "horizontal-dense" | "diagonal-up" | "diagonal-up-sparse" | "diagonal-down" | "diagonal-down-sparse" | "vertical-dashed" | "horizontal-dashed" | "horizontal-dashed-dense" | "grid-dashed" | "grid-dotted" | "dots" | "dots-sparse" | "diagonal-dots-up" | "diagonal-dots-up-sparse" | "diagonal-dots-down" | "diagonal-dots-down-sparse" | "circles-dense" | "circles" | "circles-sparse" | "blocks" | "checkerboard-xs" | "checkerboard-sm" | "checkerboard" | "checkerboard-lg" | "checkerboard-inset" | "diagonal" | "cross"; readonly fill?: string; readonly fillOpacity?: number; readonly className?: string; readonly align?: "auto" | "calendar" | "centered"; readonly fillType?: "pattern" | "solid"; readonly patternScale?: number; readonly patternStrokeWidth?: number; readonly weekendDays?: readonly number[]; readonly utc?: boolean; readonly minDayWidth?: number; readonly dateKey?: string; }; } | { readonly kind: "deadline"; readonly props: { readonly date: number; readonly label?: string; readonly pattern?: "accent" | "grid" | "none" | "horizontal" | "vertical" | "vertical-dense" | "horizontal-dense" | "diagonal-up" | "diagonal-up-sparse" | "diagonal-down" | "diagonal-down-sparse" | "vertical-dashed" | "horizontal-dashed" | "horizontal-dashed-dense" | "grid-dashed" | "grid-dotted" | "dots" | "dots-sparse" | "diagonal-dots-up" | "diagonal-dots-up-sparse" | "diagonal-dots-down" | "diagonal-dots-down-sparse" | "circles-dense" | "circles" | "circles-sparse" | "blocks" | "checkerboard-xs" | "checkerboard-sm" | "checkerboard" | "checkerboard-lg" | "checkerboard-inset" | "diagonal" | "cross"; readonly stroke?: string; readonly color?: string; readonly fillOpacity?: number; readonly strokeDasharray?: string; readonly strokeOpacity?: number; readonly strokeWidth?: number; readonly className?: string; readonly showLine?: boolean; readonly gradientToOpacity?: number; readonly fillType?: "pattern" | "none" | "solid" | "gradient"; readonly patternScale?: number; readonly patternStrokeWidth?: number; readonly dateKey?: string; readonly labelPosition?: "bottom" | "top"; readonly fade?: boolean; readonly fadeLength?: number; readonly labelColor?: string; readonly endDate?: number; }; } | { readonly kind: "trendLine"; readonly props: { readonly dataKey: string; readonly animate?: boolean; readonly opacity?: number; readonly stroke?: string; readonly strokeDasharray?: string; readonly strokeWidth?: number; readonly className?: string; readonly fadeEdges?: boolean | "left" | "right"; readonly yAxisId?: string | number; readonly strokeStyle?: "solid" | "gradient" | "dashed"; readonly gradientStart?: string; readonly gradientEnd?: string; readonly fadeEdgesLength?: number; }; } | { readonly kind: "grid"; readonly props: { readonly stroke?: string; readonly strokeDasharray?: string; readonly strokeOpacity?: number; readonly strokeWidth?: number; readonly horizontal?: boolean; readonly vertical?: boolean; readonly highlightRowValues?: readonly number[]; readonly highlightRowStroke?: string; readonly highlightRowStrokeDasharray?: string; readonly highlightRowStrokeOpacity?: number; readonly numTicksRows?: number; readonly numTicksColumns?: number; readonly rowTickValues?: readonly number[]; readonly loadingStroke?: string; readonly highlightRowStrokeWidth?: number; readonly fadeHorizontal?: boolean; readonly fadeVertical?: boolean; readonly hideHorizontalEdgeLines?: boolean; readonly hideVerticalEdgeLines?: boolean; readonly shimmer?: boolean; readonly shimmerStroke?: string; readonly shimmerLength?: number; readonly shimmerSpeed?: number; readonly shimmerSync?: boolean; }; } | { readonly kind: "yAxis"; readonly props: { readonly orientation?: "left" | "right"; readonly unit?: "number" | "percent" | "currency" | "credits" | "tokens" | "users" | "requests" | "creditsPerUser"; readonly yAxisId?: string | number; readonly domain?: readonly [number, number]; readonly numTicks?: number; readonly formatLargeNumbers?: boolean; }; } | { readonly kind: "xAxis"; readonly props: { readonly numTicks?: number; readonly tickMode?: "data" | "domain"; readonly tickerHalfWidth?: number; }; } | { readonly kind: "tooltip"; readonly props: { readonly backgroundColor?: string; readonly className?: string; readonly damping?: number; readonly rows?: readonly { readonly label?: string; readonly value?: string | number; readonly color?: string; readonly unit?: "number" | "percent" | "currency" | "credits" | "tokens" | "users" | "requests" | "creditsPerUser"; readonly dataKey?: string; readonly labelDataKey?: string; readonly colorDataKey?: string; readonly hideIfMissing?: boolean; }[]; readonly titleDataKey?: string; readonly detailDataKey?: string; readonly includeDetail?: boolean; readonly showDatePill?: boolean; readonly showCrosshair?: boolean; readonly showDots?: boolean; readonly dotSize?: number; readonly dotStrokeWidth?: number; readonly springConfig?: { readonly stiffness?: number; readonly damping?: number; readonly mass?: number; }; readonly dotVariant?: "dot" | "ring"; readonly dotRadiusFraction?: number; readonly dotScale?: number; readonly indicatorColor?: string; readonly dotColor?: string; readonly matchCrosshair?: boolean; readonly indicatorDasharray?: string; readonly indicatorFadeEdges?: "bottom" | "top" | "none" | "both"; readonly indicatorFadeLength?: number; readonly boxSpringConfig?: { readonly stiffness?: number; readonly damping?: number; readonly mass?: number; }; readonly indicatorWidth?: number | "line" | "thin" | "medium" | "thick"; }; } | { readonly kind: "gradient"; readonly props: { readonly id: string; readonly type: "linear" | "radial"; readonly stops: readonly { readonly color: string; readonly offset: number; readonly opacity?: number; }[]; readonly cx?: number; readonly cy?: number; readonly r?: number; readonly x1?: number; readonly y1?: number; readonly x2?: number; readonly y2?: number; readonly fx?: number; readonly fy?: number; }; } | { readonly kind: "referenceArea"; readonly props: { readonly fill?: string; readonly stroke?: string; readonly fillOpacity?: number; readonly strokeDasharray?: string; readonly strokeWidth?: number; readonly y1?: number; readonly y2?: number; readonly yAxisId?: string | number; readonly strokeStyle?: "solid" | "dashed"; readonly axisLabelColor?: string; }; } | { readonly kind: "bar"; readonly props: { readonly dataKey: string; readonly label?: string; readonly animate?: boolean; readonly fill?: string; readonly perspective?: boolean; readonly stroke?: string; readonly unit?: "number" | "percent" | "currency" | "credits" | "tokens" | "users" | "requests" | "creditsPerUser"; readonly yAxisId?: string | number; readonly fadedOpacity?: number; readonly lineCap?: number | "round" | "butt"; readonly animationType?: "grow" | "fade"; readonly staggerDelay?: number; readonly stackGap?: number; readonly groupGap?: number; readonly minBarHeight?: number; }; } | { readonly kind: "barSquares"; readonly props: { readonly dataKey: string; readonly label?: string; readonly animate?: boolean; readonly fill?: string; readonly stroke?: string; readonly unit?: "number" | "percent" | "currency" | "credits" | "tokens" | "users" | "requests" | "creditsPerUser"; readonly yAxisId?: string | number; readonly patternPreset?: "diagonal"; readonly fadedOpacity?: number; readonly staggerDelay?: number; readonly groupGap?: number; readonly squareGap?: number; readonly squareRadius?: number; readonly squareFit?: boolean; readonly useGradient?: boolean; readonly gradientStops?: readonly { readonly offset: number; readonly color: string; }[]; }; } | { readonly kind: "barColumnTrack"; readonly props: { readonly fill?: string; readonly opacity?: number; readonly staggerDelay?: number; readonly groupGap?: number; readonly squareGap?: number; readonly squareRadius?: number; readonly squareFit?: boolean; }; } | { readonly kind: "barXAxis"; readonly props: { readonly type?: "number" | "category"; readonly unit?: "number" | "percent" | "currency" | "credits" | "tokens" | "users" | "requests" | "creditsPerUser"; readonly tickerHalfWidth?: number; readonly showAllLabels?: boolean; readonly maxLabels?: number; }; } | { readonly kind: "barYAxis"; readonly props: { readonly showAllLabels?: boolean; readonly maxLabels?: number; }; } | { readonly kind: "barDepthProvider"; readonly props: { readonly minBarHeight?: number; readonly groundShadow?: number; }; } | { readonly kind: "barDepthBack"; readonly props: { readonly dataKey: string; readonly color?: string; }; } | { readonly kind: "barDepthFront"; readonly props: { readonly dataKey: string; }; } | { readonly kind: "barPulse"; readonly props: { readonly dataKey: string; readonly activeIndex?: number; readonly pulsePaused?: boolean; }; })[]
Required
keyKeepAliveKey<K, Ends> | undefined''The child's identity among its parent's children of one component, or a kept child's among its author's. The empty string by default.
onEmit
Show type
((events: { readonly _tag: "FocusChanged"; readonly index: number | null; } | { readonly _tag: "PhaseChanged"; readonly phase: "loading" | "exiting" | "ready" | "gridTweenReady" | "revealing" | "exitingReady" | "gridTweenLoading" | "revealingLoading"; }) => NoInfer<Msg> | undefined) | { readonly FocusChanged: (event: { readonly _tag: "FocusChanged"; readonly index: number | null; }) => NoInfer<Msg> | undefined; readonly PhaseChanged: (event: { readonly _tag: "PhaseChanged"; readonly phase: "loading" | "exiting" | "ready" | "gridTweenReady" | "revealing" | "exitingReady" | "gridTweenLoading" | "revealingLoading"; }) => NoInfer<Msg> | undefined; } | undefined
—Handle the child's events with a callback, or supply one handler per tag for tagged events. Return a parent message to dispatch it, or `undefined` to ignore the event.
props.datareadonly { readonly [x: string]: string | number | null; }[]Required
props.idstringRequired
props.ariaLabelstringRequired
props.animationDurationnumber—
props.aspectRationumber—
props.heightnumber—
props.margin
Show type
{ readonly bottom?: number; readonly left?: number; readonly right?: number; readonly top?: number; }
—
props.widthnumber—
props.stackedboolean—
props.status"loading" | "ready"—
props.orientation"horizontal" | "vertical"—
props.unit"number" | "percent" | "currency" | "credits" | "tokens" | "users" | "requests" | "creditsPerUser"—
props.responsiveboolean—
props.legendHoveredIndexnumber | null—
props.ariaDescriptionstring''
props.xDataKeystring(kind === 'bar' ? 'name' : 'date')
props.yDomainreadonly [number, number]—
props.secondaryUnit"number" | "percent" | "currency" | "credits" | "tokens" | "users" | "requests" | "creditsPerUser"—
props.yDomainTweenboolean—
props.yDomainTweenDurationnumber—
props.revealSignaturestring—
props.stackGapnumber—
props.missingValues"gap"—
props.squareSnap{ readonly squareGap: number; readonly groupGap?: number; readonly fit?: boolean; }—
props.hoverIndicatorboolean—
props.barWidthnumber—
props.barGapnumber—