Skip to content
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

Responsive charts does not maintain aspect ratio if max-width/height is specified #1395

Closed
nreynis opened this issue Aug 20, 2015 · 3 comments

Comments

@nreynis
Copy link

nreynis commented Aug 20, 2015

Responsive charts are distorted if you specify a max-width or max-heigth on the canvas element or it's parent.

I've made a fix in the following gist (sorry for the lack of proper commit). Please notice that it use getComputedStyle, so it won't work on IE<9. If you want legacy support you'll got to do some polyfilling.

https://gist.github.com/ywg/6cdb2d43ab535249a8a8

@tannerlinsley
Copy link
Contributor

Yeah, we'll need a proper commit! This looks great, but we need a way to test it in our builds. Could you pull down the latest v2.0-dev branch and submit a PR?

@toddmedema
Copy link

Following up here - would love to see this! Responsive charts are kinda broken otherwise, they look great on mobile but get HUGE on desktop

@etimberg
Copy link
Member

This has been incorporated into version 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants