Klar

Charts / React chart kit primitives / Time series

DotMatrix

Values as stacked dots, one column per period, with a highlighted range; here thirty days of revenue.

React component DotMatrix, data through props. One or more measures over a continuous run of time. Tags: dot-matrix, unit-chart, columns, daily, revenue, highlight.

Install

npm i klar-charts

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

# or copy the source:
npx shadcn@latest add https://klar.run/r/kit-dot-matrix.json

Usage

<DotMatrix
  className="mt-5"
  values={values}
  rows={14}
  height={230}
  highlight={[12, 29]}
  labels={[
    [0, haloDay(haloDays[0])],
    [12, haloDay(haloDays[12])],
    [29, haloDay(haloDays[29])],
  ]}
  formatY={(v) => `${v.toFixed(0)}K`}
/>

Related dotmatrix charts