-
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
Charts get distorted sometimes and I dont know why. please hlp #4385
Comments
@christopherdurning what version of chrome do you have? I tried with Chrome on a mac and didn't notice this even after keeping your page open for a while. The only thing I can think is that somehow there is a race condition and the size measures before the div is visible and the change is not detected. This would explain why resizing the window (which triggers the resize handlers) fixes this. @simonbrunel thoughts? |
@etimberg Chrome Version 59.0.3071.104 on mac, I just noticed a better way to reproduce the problem. Have a few tabs in the browser window, open a tab with this address http://178.62.63.252/, then switch to a different tab and then switch back and it will be distorted, try this a few times. |
hmmm, maybe something happens with chrome power saving features 🤔 |
@etimberg , just to pick your brain one last time about this issue. I noticed that this problem does not occur when you open the web page on a mobile device, not sure why that is, perhaps something to do with the screen size. In the html file (the second code snippet down from the top) is there anything wrong with the way I'm setting the column sizes for different screens (these lines col-sm-4 col-md-4 col-lg-4), I dont have a background in JS and html so this is all fairly new to me. |
I'm using charts from chart.js with bootstrap carousel. Sometimes the charts go from this pie chart working correctly to pie chart not working correctly. The charts get distorted for some reason, and whenever a chart is distorted and I make the browser window bigger or smaller using the mouse by dragging, the chart goes back to its correct working state which is strange. This only happens sometimes but it is still a problem that needs to be solved. The problems seems to occur more frequently when the browser window isn't fully expanded.
It might be also helpful to know that I have two charts on 5 different carousel pages, and every 5 seconds it moves from one page to the next. Weirdly enough, sometimes only the charts on one slide of the carousel get distorted and the others are fine, but its appears to be random which charts get distorted. Sometimes its charts on one page and other times its charts on many pages.
Check it out here.
http://178.62.63.252/
I just noticed that the charts width = 792 and height = 792 when working correctly and when its distorted that changes to width = -60 and height = -60, why would that happen?
Steps to Reproduce
Its difficult to reproduce but, open this in your browser (http://178.62.63.252/), keep it open for a while and you will see pie charts starting to get distorted, also note that changing the browser window size will make the problem go away. I think the problem is more likely to occur when the browser window isn't fully expanded. As far as I know it occurs in Google chrome and safari, I haven't tried any other browsers.
Here is my code:
The first item of the carousel with two pie charts inside(the other items are the same):
Chart js javascript file:
Javascript file which controls carousel:
The text was updated successfully, but these errors were encountered: