Skip to content
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

when margin is changed outerWidth and outerHeight need to be recalculated #5

Closed
heavysixer opened this issue Apr 11, 2014 · 1 comment
Assignees
Labels

Comments

@heavysixer
Copy link
Owner

in this example outerWidth will return the wrong value because it applies margins which are then removed in the next step. Since outerWidth and outerHeight are dependent on the margin value we need to recalculate them once margin is updated.

var chart = d4.charts.donut()
    .outerWidth($('#pie').width())
    .margin({
      left: 0,
      top: 0,
      right: 0,
      bottom: 0
   })
@heavysixer heavysixer added the bug label Apr 11, 2014
@heavysixer heavysixer self-assigned this Apr 14, 2014
@heavysixer
Copy link
Owner Author

Actually it is the height() and width() which need to be dynamically updated because the outer dimensions should stay the same irrespective of the margins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant