Open
Description
Do you want to request a feature or report a bug?
Bug report
What is the current behavior?
When creating a bar chart with only one bar available, the bar is invisible. If there's two the bars appear. This seems to be relevant to #2601.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via codesandbox or similar (template: https://codesandbox.io/p/sandbox/simple-line-chart-v25dl4).
<ChartContainer config={{ count: { label: "Count" } }}>
<BarChart data={[{ interval: new Date(), count: 10 }]}>
<XAxis
dataKey="interval"
type="number"
scale="time"
domain={[new Date().getTime(), new Date().getTime()]}
/>
<YAxis dataKey="count" type="number" />
<ChartTooltip />
<Bar dataKey="count" />
</BarChart>
</ChartContainer>
What is the expected behavior?
I expect a bar to be visible.
Which versions of Recharts, and which browser / OS are affected by this issue? Did this work in previous versions of Recharts?
Recharts 2.15.3
Chrome
MacOS