hahmed
Posts: 1
Joined: Tue Oct 26, 2021 4:50 pm

Issue with chart's height-percentage after calling Chart.update()

Hi,

If we set chart's height percentage then chart's aspect ratio remain same while shrinking or widening chat/window's width. But after calling Chart.update() the chart doesn't respond to width change anymore. Also noticed this happens only if the chart's axis length (xAxis.max) is changed by update(). Here is the issue reproduced -

https://jsfiddle.net/hasanahmed/5bkaL7wp/92/
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Issue with chart's height-percentage after calling Chart.update()

Hello hahmed,

Welcome to our forum and thanks for contacting us with your question!

I have slightly modified yout update function and it seems to work correctly now. According to docs first parametr of update method should be an object with new chart options.
Demo: https://jsfiddle.net/BlackLabel/18qmhtga/
API reference:https://api.highcharts.com/class-refere ... art#update

Let me know what do you think abou this solution.
Best regards!
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Usage”