我正在使用this包创建剪切的图表路径。 当我显示单行但显示多行时,它正在工作,但显示的是直线,但问题是虚线未显示。
这是我的代码
const DashedLine = ({ line }) => (
<Path
key={"line-1"}
d={line}
stroke={"rgb(134,65,244)"}
strokeWidth={2}
fill={"none"}
strokeDasharray={[4,4]}
clipPath={"url(#clip-path-2)"}
/>
);
const Clips = ({ x,width,xValue }) => (
<Defs key={"clips"}>
<ClipPath id="clip-path-1">
<Rect x={"0"} y={"0"} width={x(xValue)} height={"100%"} />
</ClipPath>
<ClipPath id={"clip-path-2"}>
<Rect
x={x(xValue)}
y={"0"}
width={width - x(xValue)}
height={"100%"}
/>
</ClipPath>
</Defs>
);
能帮我找出问题所在吗?