]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Add documentation note about only styling the parent div (#9115)
authorEvert Timberg <evert.timberg+github@gmail.com>
Tue, 18 May 2021 12:11:17 +0000 (08:11 -0400)
committerGitHub <noreply@github.com>
Tue, 18 May 2021 12:11:17 +0000 (08:11 -0400)
docs/configuration/responsive.md

index cb96a5d65f7746d6fe1aa2097169beab627e31c5..8f2564b1d1d4f82545fbe2a89c61b273fbe8d08b 100644 (file)
@@ -6,6 +6,7 @@ The following examples **do not work**:
 
 - `<canvas height="40vh" width="80vw">`: **invalid** values, the canvas doesn't resize ([example](https://codepen.io/chartjs/pen/oWLZaR))
 - `<canvas style="height:40vh; width:80vw">`: **invalid** behavior, the canvas is resized but becomes blurry ([example](https://codepen.io/chartjs/pen/WjxpmO))
+- `<canvas style="margin: 0 auto;">`: **invalid** behavior, the canvas continually shrinks. Chart.js needs a dedicated container for each canvas and this styling should be applied there.
 
 Chart.js provides a [few options](#configuration-options) to enable responsiveness and control the resize behavior of charts by detecting when the canvas *display* size changes and update the *render* size accordingly.