Nivo: Adaptive resize height and width responsive

Created on 19 Apr 2019  路  3Comments  路  Source: plouc/nivo

Nivo charts have always automatically resized when the width changes, but not the height. Now, the examples on the website resize vertically and horizontally when you resize the page.

I have wrapped some charts in react-measure, but it is cumbersome and it looks like there might be a better way to do it like the example. What is the best way to do this?

resize-adapt-horiz-and-vertical

Most helpful comment

You just need to have a parent container with a defined size.

All 3 comments

Responsive components are already wrapper in react-measure, use ResponsiveLine for example instead of Line

Also it was already the case before, it's just that now the website uses a percentage instead of a fixed value.

You just need to have a parent container with a defined size.

Was this page helpful?
0 / 5 - 0 ratings