[英]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.