Klar

Charts / React science and statistics charts / Distribution

Histogram with density

A histogram with its kernel density, a fitted normal, quantile tails and a summary box, for judging skew and fit at a glance.

React component HistogramDensity, data through props. The shape of many values: swarms, ridges, heat. Tags: histogram, density, kde, normal-fit, quantiles, skew, distribution.

Install

npm i klar-charts

import 'klar-charts/styles.css'
import { ThemeScope, HistogramDensity } from 'klar-charts'

# or copy the source:
npx shadcn@latest add https://klar.run/r/sci-histogram-density.json

Usage

<HistogramDensity values={systolic} height={384} bins={48} domain={[80, 200]} axisLabel="Systolic BP (mmHg)" unit="mmHg" showNormal={fit === 'both'} />

Related histogram with density charts