SpikeChart

A chart for displaying discrete events or spikes over time, similar to Cloudflare's blocked requests visualization.

Playground

Visualize event spikes with a baseline reference:

Props

Midnight
Code
<SpikeChart
  data={data}
  theme="midnight"
  label="Blocked Requests"
/>

Usage

tsx
<SpikeChart
  data={eventData}
  dataKey="value"
  timeKey="time"
  theme="midnight"
  width={800}
  height={220}
  label="Blocked Requests"
/>

Props

PropTypeDefaultDescription
data*T[]-Data array
dataKeykeyof T"value"Key for values
timeKeykeyof T"time"Key for time axis
widthnumber600Chart width
heightnumber200Chart height
theme*ThemeName-Theme name
baselineColorstring-Override baseline color
labelstring"Allowed Requests"Tooltip label