({
dataKey,
fill,
curve = curveMonotoneX,
}: PatternAreaProps)
| 23 | * Pair with `PatternLines` in `AreaChart` children and an `Area` with `fillOpacity={0}` for the stroke line. |
| 24 | */ |
| 25 | export function PatternArea({ |
| 26 | dataKey, |
| 27 | fill, |
| 28 | curve = curveMonotoneX, |
| 29 | }: PatternAreaProps) { |
| 30 | const { data, xScale, yScale, xAccessor } = useChartStable(); |
| 31 | |
| 32 | return ( |
| 33 | <AreaClosed |
| 34 | curve={curve} |
| 35 | data={data} |
| 36 | fill={fill} |
| 37 | x={(d) => xScale(xAccessor(d)) ?? 0} |
| 38 | y={(d) => { |
| 39 | const v = d[dataKey]; |
| 40 | return typeof v === "number" ? (yScale(v) ?? 0) : 0; |
| 41 | }} |
| 42 | yScale={yScale} |
| 43 | /> |
| 44 | ); |
| 45 | } |
| 46 | |
| 47 | PatternArea.displayName = "PatternArea"; |
| 48 |
nothing calls this directly
no test coverage detected