Set height and width for responsive chart using recharts ( Barchart )
问题 I am trying to use recharts to implement a BarChart. But the width={600} and height={300} causes the Barchart to be absolute, not responsive. How to make the Barchart a responsive one? I tried using percentage as width={'50%"} height={"40%"} but did not work. import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, Legend } from 'recharts'; <BarChart className="barChart" width={600} height={300} data={data} margin={{top: 5, right: 30, left: 20, bottom: 5}} label="heaf"> <CartesianGrid