highcharts - Is modifying chart.hasUserSize a bad idea after calling Chart.setSize()? -
when using chart.setsize() i've noticed value chart.hasusersize gets set true. once hasusersize = true chart no longer respond resize events if window changes dimensions if set hasusersize false again responds resize events.
i've created ux allows user "expand" chart container 100% width once i've called setsize() no longer auto resizes until remove hasusersize=true value.
since it's not documented part of api should considered hack? problem don't see documented way re-enable resizing code natively in highcharts once you've called setsize().
it's working want right don't want leave wart in code may come bite me in future versions of highcharts.
chart.hasusersize = false
here's jsfiddle that, when window resized, demonstrates i'm talking included "hack". resize window/chart pane before clicking anything, click size button , resize , it'll respond on width. comment out "chart.hasusersize = false" lines , try resizing. it's not perfect example gets point across use of hasusersize = false.
is right thing reclaim sizing behavior after calling setsize()?
Comments
Post a Comment