Change the viewPort? #3754
-
Hey! When I try to implement the BarChart (https://recharts.org/en-US/examples/SimpleBarChart) the viewport on the right side is a lot bigger then the left side. I would like to get it even on all four sides. Is their a way I can make this happen? You can look on the img I have provided. Thanks for the understanding that I am new to this and would like all the help and explanation possible. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Hi, welcome! There is some default margin on the charts so they fit the space that they are in. You can adjust that margin to whatever fits your needs. Here it is at 0 This still has some extra space on the left and the bottom (we need room for the axes) but you should be able to adjust those numbers to what looks best to you |
Beta Was this translation helpful? Give feedback.
I guess its hard to do anything without an actual reproduction. I can wrap things in divs and get the same result as above - everything is as tight to the container as possible without cutting things off. On the left and the bottom
https://codesandbox.io/s/simple-bar-chart-forked-7jl977?file=/src/App.tsx
Can you try to modify the sandbox to represent the issue better?