-
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
mobile browser odd behaviour #713
Comments
when i looked at this the problem seems to arrive from the helper function retinaScale() which continues to scale the graph every time it is initialized on an already used canvas |
yeah. But this is something which is to be fixed soon |
Still needs fixing! Same problem on using with Cordova app on android 4.4.4. Chart draws OK first time then canvas grows every time afterwards, eventually causing a crash. |
http://jsfiddle.net/leighking2/1sc6L8dk/9/ See this solution as quince pointed out. |
Thanks, nits. I can confirm that removing 'helpers.retinaScale(this)' from the constructor solves it for a Cordova app on Android 4.4.4 |
So an easy solution for you would be to not reuse the canvas html element, and recreate it when you recreate the chart itself. You should also use the That said, I think the library should cleanup the original canvas back to it's original size, and remove any applied styles within |
Thanks Nick. I'll try that later although the modification to chartjs regards
|
jsfiddle: http://jsfiddle.net/1sc6L8dk/5/
Open this jsfiddle in mobile browser (I am using safari,chrome).
If you click on "click here to draw" you will see the graph generated which is perfectly fine on Mozilla, Chrome, Safari (all latest desktop browsers).
Now when I try doing the same in mobile browser(iPhone 5 Safari, Samsung S4 Chrome) this behaves really strange. If you click on graph for second time, this graph will appear double of its first size and then again the same. It just gets expanded where it should behave like how it behaves in desktop browser.
First I thought this might be the issue only with PolarArea, but same issue appears with Pie too. You can check the same just changing PolarArea to Pie.
Any ideas on this ? May be some small mistake in my code?
Thanks in advance.
http://stackoverflow.com/questions/26495262/generating-chartjs-graph-dynamically-odd-behavior-in-mobile-browsers
Posted this question here earlier.
The text was updated successfully, but these errors were encountered: