[英]Added border radius to the background of bar chart in Recharts
我正在尝试创建一个带有自定义样式的条形图。 所以需要到栏的边界半径。 能够将边框半径添加到栏,但不能将边框半径添加到剩下的背景。 知道我怎样才能做到这一点。 在下面添加了我的代码。 先感谢您。
<BarChart
data={timelineDetailsData(metrics.dates.today, metrics.dates.middle)}
barGap={14}
margin={{
top: 0,
right: 0,
left: 0,
bottom: 0
}}
maxBarSize={2000}
barSize={100}
layout="vertical">
<XAxis
domain={[0,
monthDiff(
new Date(parseInt(metrics.dates.today.split(" ")[1]), getMonthsinNumber[metrics.dates.today.split(" ")[0].toLowerCase()]),
new Date(parseInt(metrics.dates.latest.split(" ")[1]), getMonthsinNumber[metrics.dates.latest.split(" ")[0].toLowerCase()])
)]} tick={false} axisLine={false} type="number" tickLine={false} padding={{ left: 0, right: 0 }} />
<YAxis type="category" dataKey="currency" axisLine={false} tickLine={false}
/>
<Bar background dataKey="middleDate" fill="#2E76B6" radius={10} barSize={60} >
<LabelList dataKey="timelabel" position="insideLeft" style={{ fill: "white" }} />
</Bar>
</BarChart>
<Bar
background={{
radius: 20
}}
/>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.