Grid

Subtle background gridlines aligned with axis nice-ticks. Place as the first child of ChartRoot for correct z-order.

Primitive: ChartGrid

Interactive demo

Usage

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

<ChartRoot data={data} height={200}>
  <ChartGrid horizontal vertical />
  <ChartLine />
</ChartRoot>

Props

PropTypeDefaultDescription
horizontalbooleantrueRender horizontal gridlines (Y ticks)
verticalbooleanfalseRender vertical gridlines (X ticks)
tickCountnumber4Horizontal tick count (match ChartAxisY)
verticalTickCountnumber6Vertical tick count
strokeDasharraystring'3 3'Dash pattern (use "" for solid)
classNamestringClass on the grid <g>