CartesianGrid
父组件
CartesianGrid consumes context provided by these components:
Properties
xNumber
x 坐标。
yNumber
y 坐标。
widthNumber
宽度。
heightNumber
高度。
horizontalBoolean
是否展示水平方向的网格线。
默认值:
trueverticalBoolean
是否展示竖直方向的网格线。
默认值:
truehorizontalPointsArray
所有水平网格线的 y 坐标。
默认值:
[]horizontalCoordinatesGeneratorFunctionoptional
生成所有水平线的 y 坐标的函数。生成器传递一个形状为 { yAxis, width, height, offset } 的对象。
格式:
<CartesianGrid strokeDasharray="3 3" horizontalCoordinatesGenerator={(props) => props.height > 250 ? [75, 150, 225] : [100, 200]} />verticalPointsArray
所有竖直网格线的 x 坐标。
默认值:
[]verticalCoordinatesGeneratorFunctionoptional
生成所有垂直线的 x 坐标的函数。生成器传递一个形状为 { xAxis, width, height, offset } 的对象
格式:
<CartesianGrid strokeDasharray="3 3" verticalCoordinatesGenerator={(props) => props.width > 450 ? [150, 300, 450] : [200, 400]} />fillStringoptional
网格之间用于填充的背景颜色
默认值:
"none"格式:
<CartesianGrid strokeDasharray="3 3" fill="red" /> <CartesianGrid strokeDasharray="3 3" fill="#ccc" />fillOpacityNumberoptional
网格之间用于填充的背景的透明度
格式:
<CartesianGrid strokeDasharray="3 3" fill="red" fillOpacity={0.6} />strokeDasharrayStringoptional
用于绘制网格的虚线和间隔的模式
格式:
<CartesianGrid strokeDasharray="4" /> <CartesianGrid strokeDasharray="4 1" /> <CartesianGrid strokeDasharray="4 1 2" />xAxisIdString | Number
区域图对应的 x 轴的 id 。
默认值:
0yAxisIdString | Number
区域图对应的 y 轴的 id 。
默认值:
0