Pattern

Subtle SVG background pattern (dots, dashed lines, crosses) drawn behind chart content. Place as the first child of ChartRoot.

Primitive: ChartPattern

Interactive demo

Usage

import { ChartRoot, ChartPattern, ChartLine } from '@ramtt/charts'

<ChartRoot data={data} height={200}>
  <ChartPattern variant="dots" spacing={16} />
  <ChartLine />
</ChartRoot>

Props

PropTypeDefaultDescription
variant'dots' | 'lines' | 'crosses' | 'none''dots'Pattern style
opacitynumber0.3Pattern opacity
spacingnumber16Spacing between pattern units in px
classNamestringClass on the pattern <g>