-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Bug with responsiveness on ios - safari with version 2.6.0 #4622
Comments
`<script type="text/javascript">
|
@fporrata do you have a fiddle that reproduces this? What does your HTML look like before and after the chart is created? |
This is the site that creates the chart. There is some C# code that creates dataset0 but it is just a few X Y points. Here is the link: http://myrfs.rfsworld.com/jumperspecs/jumperdemo/default.aspx |
Here is a zip file of the code: |
@fporrata not related to your issue but I noticed that your site uses resources from Maybe related to your issue: you are trying to load Chart.js via HTTP but your site is HTTPS: you could try with
|
Thank you, already made the changes. |
It looks like the problem was with the Jquery version. Now the chart shows up but it is all squished in portrait. Can someone try it and let me know how to fix the squished chart? When the Iphone is in landsacpe the chart looks great. |
Did you try the suggested solution in this comment? |
Yes, it did not help. The chart just renders as it appears in the picture above. |
Did you set |
I did it like this in code when checking the window width < 481: lineChart.options.maintainAspectRatio = 'false'; and it did not work. I set it in the options directly and it works. Now the problem is that when the phone is change to landscape, the chart gets squished. Let me know if you have a solution for both portrait and landscape. Thanks for all your help. |
If you change the options after the chart creation, you need to call A solution that works in both orientations really depends on what you used as I think in your case it might be simpler to use the built-in aspect ratio. I would switch <div id="wrapper" style="position: relative"> new Chart(ctx, {
options: {
responsive: true,
maintainAspectRatio: true,
aspectRatio: 1, // width == height
// ...
}
}); |
Closing per @simonbrunel's answer |
Chart displays fine in Chrome and other browsers but does not work with Iphone (Safari 10.3).
Tried using setTimeout, ChartArea backgroundColor, etc. Here is the code:
The text was updated successfully, but these errors were encountered: