Reference line

Horizontal dashed reference line at a Y value with optional label rendered to the right of the chart area.

Primitive: ChartRefLine

Interactive demo

Usage

import { ChartRoot, ChartRefLine } from '@ramtt/charts'

<ChartRoot data={data} height={200}>
  <ChartRefLine y={breakEven} label="Break-even" />
</ChartRoot>

Props

PropTypeDefaultDescription
y*numberY value where the line is rendered
labelstringOptional label to the right of the line
classNamestringTailwind classes for the line stroke
animateAnimateConfigtrueEntry animation