Responsive charts issue when using FlexBox or CSS grids
See original GitHub issueReproducible demo here: https://codesandbox.io/s/lp16vvz6n7
As you can see, the top chart here (in the flex row) is not responsive.
Happy to help contribute if no one on the core team immediately knows. It might have something to do with react-measure that’s used in @nivo/core
for the <ResponsiveWrapper>
component.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:17
- Comments:19
Top Results From Across the Web
Recharts Responsive Container does not resize correctly in ...
It seems rather hacky but a viable fix is to set width to 99% with a height or aspect ratio. <ResponsiveContainer width="99%" aspect={3}>....
Read more >Relationship of grid layout to other layout methods - CSS
In this guide, I will explain how a grid fits together with other ... The basic difference between CSS Grid Layout and CSS...
Read more >Solving Layout Problems With CSS Grid and Friends - YouTube
CSS Grid Layout launched into the majority of our browsers in 2017. As designers and developers have started to use Grid Rachel has...
Read more >A Complete Guide to CSS Grid
CSS Grid properties ; justify-items · start – aligns items to be flush with the start edge of their cell; end ; align-items...
Read more >Difference between CSS Grid and CSS Flexbox
CSS Grids helps you create the outer layout of the webpage. You can build complex as well responsive design with this. This is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I solved this issue with the AutoSizer HOC.
Because of the known issues like “infinitely growing diagrams” I almost always use the AutoSizer wrapper in favour of the <Responsive*> components.
I think I had a similar issue where my
<ResponsiveBar>
would respond if zooming out but would not shrink when zooming in with my React app. The fix was to put the<ResponsiveBar>
into a<div>
that had awidth
of less than 100%.So the following fixed my problem: