I want to change highchart's width on button click, I know I can do it using chart.setSize
function, but it sets the width only in pixels. But I need to set the width in percentage.
Here is the sample JSFiddle, in which I have tried to reset the width in 3 ways. Only Button 1 works, but not the remaining 2.
Please let me know how can I reset the width in percentage.
you could do it like button4
here :
var chart = $('#container').highcharts();
var el = $('.chart-inner');
el.css('width','100%');
chart.setSize(el.width(),el.height(),true);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With