Last active
December 7, 2022 17:49
-
-
Save julian-boolean/8339982 to your computer and use it in GitHub Desktop.
dynamically resize rickshaw chart.
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
$(window).on('resize', function(){ | |
graph.configure({ | |
width: window.innerWidth - 20, | |
height: window.innerHeight - 20 | |
}); | |
graph.render(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can also directly use the width and height of the parent
div
bydocument.getElementById('mychart').getBoundingClientRect()
and use.width
and.height
properties of the result.