New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to make charts a fixed height? #3384
Comments
You can set max height on its container. Here is an example: http://codepen.io/pen?template=JXVYzq |
Thank you @zachpanz88 ! That worked great. Is there a way to let the width stretch to 100% while keeping a max-height on the element? It looks awkward for me to have a max-width and max-height on these charts. See screenshot below. |
You can remove the max-width. If you do not set a width and height on the canvas it will be responsive without a certain aspect ratio. |
Closing as issue appears to be solved |
To get a fixed height and variable width chart…
Here is a demo: |
@beausmith thank you for saving my day!! |
I've done it with this code |
https://codepen.io/nicdnepr/pen/yLeOLdB |
I have tried to change the height/width on the canvas element but it still seems to stretch to full browser width/height. Is there a way to make the canvas a fixed height but maintain the responsiveness of the charts? Thank you!
The text was updated successfully, but these errors were encountered: