-
-
Notifications
You must be signed in to change notification settings - Fork 837
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
Passing chart size (width / height) as prop doesnt resize the chart #8
Comments
Hi, thanks for the issue. It's fixed in the current version 1.1.2 However you have to pass the width and height like this:
Because the props are numerical. And you need to disable the chartjs reponsive option. http://www.chartjs.org/docs/#chart-configuration-global-configuration There are two options in there, If you set If you won't both, a fix width or max-width and responsiveness, then you can simply wrap the canvas into a div with a class.
|
Thanks! it works now!. 🎉 |
why i set width and height, but result not i want, example: except width: 200; height: 100, but result not match except |
Like exaplained in the chart.js docs you have to pass the options object with {
responsive: false,
maintainAspectRatio: false
} Just checkout some of the examples |
i've tryed to change props at media but my canvas didn't updated, is there any ideas? |
Expected Behavior
The chart should of the one specified in the props
Actual Behavior
Appears to be 100% of the view port.
Environment
I'm using vueify and have something like this:
Is this the correct way to pass these properties to alter the size of the chart?
The text was updated successfully, but these errors were encountered: