Usage
Props
If set false, no horizontal grid lines will be drawn.Can also be an object with SVG line props, a custom element, or a render function.
If set false, no vertical grid lines will be drawn.Can also be an object with SVG line props, a custom element, or a render function.
The stroke color of grid lines.
The pattern of dashes and gaps used to paint the lines of the grid.
The background color used to fill the space between grid lines.
The opacity of the background used to fill the space between grid lines.
Defines background color of stripes.The values from this array will be passed in as the
fill property in a rect SVG element.In case there are more stripes than colors, the colors will start from beginning.
So for example: horizontalFill={['yellow', 'black']} produces a pattern of yellow|black|yellow|blackIf this is undefined, or an empty array, then there is no background fill.
Note: Grid lines will be rendered above these background stripes.Defines background color of stripes.The values from this array will be passed in as the
fill property in a rect SVG element.In case there are more stripes than colors, the colors will start from beginning.
So for example: verticalFill={['yellow', 'black']} produces a pattern of yellow|black|yellow|blackIf this is undefined, or an empty array, then there is no background fill.
Note: Grid lines will be rendered above these background stripes.If true, only the lines that correspond to the axes ticks values will be drawn.
If false, extra lines could be added for each axis (at min and max coordinates), if there will not such ticks.
horizontalPoints, verticalPoints, horizontalValues, verticalValues have priority over syncWithTicks.
Array of coordinates in pixels where to draw horizontal grid lines.
Has priority over syncWithTicks and horizontalValues.
Array of coordinates in pixels where to draw vertical grid lines.
Has priority over syncWithTicks and verticalValues.
Array of values, where horizontal lines will be drawn. Numbers or strings, in dependence on axis type.
Has priority over syncWithTicks but not over horizontalPoints.
Array of values, where vertical lines will be drawn. Numbers or strings, in dependence on axis type.
Has priority over syncWithTicks but not over verticalPoints.
A function that generates the y-coordinates of all horizontal lines.
A function that generates the x-coordinates of all vertical lines.
The x-coordinate of grid.
If left undefined, it will be computed from the chart’s offset and margins.
The y-coordinate of grid.
If left undefined, it will be computed from the chart’s offset and margins.
The width of grid. If undefined, covers the full width of the chart plot area.
The height of grid. If undefined, covers the full height of the chart plot area.
The id of XAxis which is corresponding to the data. Required when there are multiple XAxes.
The id of YAxis which is corresponding to the data. Required when there are multiple YAxes.
Z-Index of this component. CartesianGrid typically renders behind other elements.
Source
https://github.com/recharts/recharts/blob/main/src/cartesian/CartesianGrid.tsx