Annotations

Add reference lines and areas to highlight thresholds, targets, safe ranges, or notable regions on your charts.

Reference Lines

Draw horizontal or vertical lines at specific values:

0.0 ms121.8 ms243.7 ms0:0012:0023:00WarningCritical
tsx
<LineChart
  data={data}
  series={[{ key: 'latency', label: 'Latency' }]}
  theme="midnight"
  annotations={[
    { type: 'line', value: 100, axis: 'y', label: 'Warning', color: '#f59e0b' },
    { type: 'line', value: 150, axis: 'y', label: 'Critical', color: '#ef4444' },
  ]}
/>

Reference Areas

Highlight ranges with filled areas:

0.0 ms121.8 ms243.7 ms0:0012:0023:00NormalCritical
tsx
<LineChart
  data={data}
  series={[{ key: 'latency', label: 'Latency' }]}
  theme="midnight"
  annotations={[
    { type: 'area', start: 0, end: 80, axis: 'y', color: '#22c55e', opacity: 0.1, label: 'Normal' },
    { type: 'area', start: 80, end: 120, axis: 'y', color: '#f59e0b', opacity: 0.1 },
    { type: 'area', start: 120, end: 200, axis: 'y', color: '#ef4444', opacity: 0.1, label: 'Critical' },
  ]}
/>

Lines + Areas

Combine lines and areas for comprehensive annotations:

Center XCenter Y-9.06520.02749.1278.212107.305-3.09424.84552.78480.723108.662

Label Positioning

Control where labels appear with labelPosition:

0.0 ms121.8 ms243.7 ms0:0012:0023:00Start (default)CenterEnd

Supported Charts

Annotations are supported in the following chart components:

  • LineChart - via annotations prop
  • BarChart - via annotations prop
  • ScatterChart - via annotations prop
  • ComboChart - via annotations prop

ReferenceLine Props

PropTypeDefaultDescription
type*"line"-Annotation type
value*number-Value on the axis
axis*"x" | "y"-Which axis to draw on
colorstring-Line color (defaults to theme accent)
strokeDasharraystring"4,4"Line dash pattern
strokeWidthnumber1Line width
labelstring-Optional label text
labelPosition"start" | "center" | "end""start"Label position

ReferenceArea Props

PropTypeDefaultDescription
type*"area"-Annotation type
start*number-Start value
end*number-End value
axis*"x" | "y"-Which axis to draw on
colorstring-Fill color (defaults to theme accent)
opacitynumber0.1Fill opacity
labelstring-Optional label text