0

Let's say I have this chart: enter image description here

I need to minimize gaps between the bars.

I'm aware about this answer,but if you provide barCategoryGap property, the width of the bars will be increased.

U need to end up with smth like that: enter image description here

So, there should be no gaps (1px is ok) between the bars and bars should have 10-15px width

I have tried to change next properties:barCategoryGap, barGap, barSize but nothing helps.

Sandbox

1 Answers1

1

I'm not sure if this is what you want but after playing around a bit this is what i got. I notice you have the barSize prop in the <Bar> component. What i've got so far.

<div>
  <ResponsiveContainer width="100%" height="100%">
   <BarChart data={data} barGap="1%">
     <CartesianGrid strokeDasharray="3 3" />
     <XAxis dataKey="name" />
     <YAxis />
     <Tooltip />
     <Legend />
     <Bar dataKey="pv" fill="#8884d8" />
   </BarChart>
  </ResponsiveContainer>
</div>
Tom
  • 107
  • 7