nivo: Endless scaling animation when a ResponsiveChart is placed in CSS grid?
What i’m trying to do is to have a an arbitrary sized dashboard tile layouted with CSS grid.
I’m not sure why the ResponsiveBar
shown in my Codesandbox example is infinitely scaled up?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 16
- Comments: 15
I just ran across this issue using css grid and found a workaround that’s working for me. Placing the chart inside a position: absolute container inside a position: relative container seems to let it resize properly. Maybe this will be helpful for someone.
https://codesandbox.io/s/1rzl826krj
Is there any update regarding this issue, or is the absolute-positioning workaround the recommended approach?
As of 0.72.0 bug still exists, workaround does not work.
I experienced the melting bug. I wrote a component that I use on each of my Nivo charts, it uses @shea’s absolute container to avoid problems in a CSS grid.
This component also sets a default height, and accepts a height prop from the parent. (Since all Nivo elements currently require a specific height on the parent container.)
This is not well tested but fixed my melting problems today:
As of 0.69.1 this bug still exists.x.
I’m getting the same problem on a design using css-grid. Any news on that issue? Thanks
I’m having the same melting problem. Using a fixed height works, but my parent component can be scaled and therefore fixed height is not an option.
I think I have a solution that works without using grid css or setting height in lineSettings.
Then in MyChart I remove width and height from lineSettings and return this
The ‘container’ style is from bootstrap. In this case it just makes width 100% so you can alternatively use style={{ width: ‘100%’ }} instead.