Trouble with pie chart height #1171
-
|
Hi, I'm using the pie chart shape. I've got trouble with responsive. Currently, the pie chart is bigger than the div. You can see below an example of what's happening : The pie chart should stay in the grey div. In our page, we use the ParentSize function, like this : For the Pie Chart component, we have this : I tried to edit width and height values for the svg bloc, the Group bloc. Can you help me on that ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hey @GoldenIvan 👋 thanks for checking out Some initial thoughts though:
|
Beta Was this translation helpful? Give feedback.

Hey @GoldenIvan 👋 thanks for checking out
visx. Would it be possible to put this in a codesandbox for easier tinkering? It's challenging to fully debug without that. For instance is the container overflow the grey container or the green container?Some initial thoughts though:
Group(rendered as a<g />) doesn't have inherit dimensions, it depends on its child contentswidth / 2for pie radius. Given that the shape is a circle and your angles are going from-PI, PI, that means theheightwould also bewidth / 2(since you are rendering half a circle). Instead of usingwidth / 2for yourheightvalues, you are usingh…