Skip to Content

Gridlines

The Gridlines component in REAVIZ provides a visual representation of the value marks in a chart. You can customize the grid lines to render only the x-axis, y-axis, or both, enhancing the readability and clarity of your data visualizations.

Where to use:

  • Enhance Readability: Ideal for improving the readability of charts by providing reference lines.
  • Visualize Data Points: Useful for visually aligning data points with their corresponding values.
  • Custom Gridlines: Great for customizing the appearance of gridlines to match the style of your chart.

Examples

API

GridlineSeriesΒ 

NameTypeDefault
yScaleany

D3 scale for Y Axis.

xScaleany

D3 scale for X Axis.

yAxisLinearAxisProps

The linear axis component for the Y Axis of the chart.

xAxisLinearAxisProps

The linear axis component for the X Axis of the chart.

heightnumber

Height of the chart.

widthnumber

Width of the chart.

lineGridLineElement | null

Gridline that is rendered.

`<Gridline direction="all" />`
stripeGridStripeElement | null

GridStripe that is rendered.

GridlineΒ 

NameTypeDefault
heightnumber

Height of the line set by the GridlineSeries.

widthnumber

Width of the line set by the GridlineSeries.

classNamestring

CSS Classname to apply.

direction"all" | "x" | "y"

Direction set by the GridlineSeries.

'all'
scaleany

D3 Scale set by GridlineSeries.

strokeWidthnumber

SVG Stroke Width Property.

1
strokeColorstring

SVG Stroke Color Property.

'rgba(153, 153, 153, 0.5)'
datanumber

Data point for the position set by the GridlineSeries.

indexnumber

Index set by the GridlineSeries.

strokeDasharraystring

SVG Stroke Dash Array Property.

'2 5'

GridStripeΒ 

NameTypeDefault
position"horizontal" | "vertical"

Position set by the GridlineSeries.

classNamestring

CSS Classname to apply.

fillstring

Stripe fill color.

'#393c3e'
heightnumber

Height of the line set by the GridlineSeries.

widthnumber

Width of the line set by the GridlineSeries.

direction"all" | "x" | "y"

Direction set by the GridlineSeries.

scaleany

D3 Scale set by GridlineSeries.

datanumber

Data point for the position set by the GridlineSeries.

indexnumber

Index set by the GridlineSeries.

Last updated on