-
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
Fix resize problems when charts are initially hidden #1467
Merged
tannerlinsley
merged 10 commits into
chartjs:v2.0-dev
from
etimberg:feature/resize_problems
Sep 19, 2015
Merged
Fix resize problems when charts are initially hidden #1467
tannerlinsley
merged 10 commits into
chartjs:v2.0-dev
from
etimberg:feature/resize_problems
Sep 19, 2015
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…due to the application of margins on the scale
…problems Conflicts: gulpfile.js
This reverts commit a36a3f8.
@tannerlinsley @derekperkins please give this a good look over |
Amazing work! Merging. |
tannerlinsley
added a commit
that referenced
this pull request
Sep 19, 2015
Fix resize problems when charts are initially hidden
This was referenced Sep 19, 2015
tannerlinsley
added a commit
that referenced
this pull request
Sep 21, 2015
Updated PR to replace #1467
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit aims to fix the resize problems for charts documented in #592 #762 #961 #1020 #1311 and #1395
It also possibly also fixes #1006 but this has not been tested.
New Dependency
Cloned
javascript-detect-element-resize
into the chart.js organization. Use this to detect when an individual canvas element resizes. This removes the need for thecore.responsive
file and so it is removed.Aspect Ratios
Charts can now force an aspect ratio if the user does not specify the original canvas size. This will make the doughnut canvas square for instance if the user does not give it a size.
Canvas Size
Using the gist from #1395, the max-width property of the parent container should now be obeyed.
destroy
no longer changes the canvas stylewidth
andheight
properties.Category Scale
Fixed a size issues caused by the category scale that caused the chart to not take up the entire canvas when the labels may have needed to rotate.
Doughnut and Polar Area Charts
Ensure that internal
innerRadius
andouterRadius
properties are always >= 0 even when the canvas has no size (ie isdisplay: none
). This prevents crashes.Samples
Updated the bar sample to hide the chart with a
display: none
style. Use the 'show' button to show the canvas container which triggers a resize.