for me, i set chart width:

    chart: {
        backgroundcolor: 'white',
        ..... }

and in html set overflow:auto

<div id="container" style="**width:100%;overflow:auto**;" ></div>


i struggled with this for way too long, and found a solution that works for me. a little bit of background on my setup:

  1. the highcharts chart was loading on a tab on my website that is not visible upon logging into the site.
  2. when switching to that tab, the chart was well outside the div.

so, i attached a unique id to that particular tab, we'll call it tab5, and then bound a click function that forced - and this is the important part - the <svg> element within the container div to 100% using jquery:

$('#tab5').bind('click', function() {
    $('#container_div svg').width('100%');

...and my sanity has been restored. for the moment.


please add width:100% to chart container.
hope this will resolve overflow:hidden related issue.

classname{min-height:450px;width: 100%;}


try and encapsulate the highchart generation inside a pageshow event

$(document).on("pageshow", "#hg_graph", function() {...});


i resolved this problem (for my case) by ensuring that the containing ui elements render before the chart, allowing highcharts to calculate the correct width.

for example:


var renderchart = function(){


var renderchart = function(){
settimeout(renderchart, 0);


i have been having this issue too, and the .highcharts-container css solution wasn't working for me. i managed to solve it for my case by splitting out an ng-class condition (which was setting different widths for the container div) into separate divs.

eg, this

<div ng-class="condition?'col-12':'col-6'">


<div ng-show="condition" class="col-12">
<div ng-show="!condition" class="col-6">

i couldn't really tell you why it worked though. i'm guessing the ng-class takes longer to calculate the container width and so highcharts renders first with an undefined width? hopefully this helps someone anyway.


i also have the same issue in my app where i am using angular and i also using ngcloak directive which i have removed as i don't need it

after doing this my problem is solved.


i have just seen that sometimes there are several issues going on at the same time.

if it happens the height exceed the expected heigh:

scss style:



    .highcharts-container{position: absolute; width:100% !important;height:100% !important;}

if the width exceeds the container (bigger than what's supposed to) or does not resize properly to smaller one:

    let element = $("#"+id);

    // for some reason it exceeds the div height.
    // trick done to reflow the graph. 
    }, 100 );

the last one happened to me when destroying the chart and creating a new one... the new one was coming with width extra size.


i have been also bump into this issue. both affected in desktop and mobile view of the chart.

in my case i have a chart that update the series color depending on min or max.after updating the points, the highcharts width exceeds container div on its first load.

to fix that, what i did is add chart.reflow(); after the update of points.


//first declare the chart
var chart = $('#topplayer').highcharts();
//set the min and max
var min = chart.series[0].datamin; //top losser
var max = chart.series[0].datamax; //top winner

for (var i = 0; i < chart.series[0].points.length; i++) {
    if (chart.series[0].points[i].y === max) {
            color: 'green',
    if (chart.series[0].points[i].y === min) {
            color: 'red',

// redraw the chart after updating the points

hope this helps to those who has the same issue like me. :)


here's a solution that worked for me ! the charts were working fine for a while and then after a feature they started exceeding their container. turns out it was the defer attribute on the script in the head of my application.

try removing defer on your javascript tags:

<script defer src="script.js"></script> to <script src="script.js"></script>

or moving my stylesheet link higher in the head also seemed to fix it but it's a less reliable solution..


this may have been introduced since the op in 2013, but you should be able to set height with chart.height (

                options: {
                    chart: {
                        type: 'bar',
                        height: window.innerheight + 'px',
                    title: {
                        text: 'top 10 users',
                    subtitle: {
                        text: 'by scores',

this is a web based solution, but i would expect you could cater it to


none of the answers helped me. i dynamically change chart data and the top answer solution ruins the animations and causes a jump in the chart position.

the workaround that i finally came up with was to set some padding for the chart wrapper element (in my case some part of the chart to left was hidden, so i gave some left padding), and then set the chart main element overflow property to visible. it works and the animations are just fine. you may need some experimenting with padding value to get it perfectly displayed.

<div class="chart-wrapper">
   <!-- high charts main element here -->

and the style

  padding-left: 20px;

.chart-wrapper > div:first-child{
  overflow: visible !important;


i just ran into the same problem today - not on mobile, but with a window sized small on first page load. when the page loads, the chart is hidden, then after some selections on the page, we create the chart. we have set a min-width and max-width for the container in css, but not a width.

when the chart is being created, it needs to determine the dimensions to create the svg . since the chart is hidden, it cant get the dimensions properly so the code clones the chart container, positions it off-screen and appends it to the body so that it can determine the height/width.

since the width is not set, the cloned div tries to take as much space as it can - up to the max-width that i had set. the svg elements are created using that width, but added to the chart container div which currently is smaller (based on the size of the screen). the result is that the chart extends past the container div's boundaries.

after the chart has rendered the first time, the on-screen dimensions are known and the clone function is not called. this means that any window resizes, or reloading of the chart data cause the chart to size correctly.

i got around this initial-load problem by overriding the highcharts function clonerenderto which clones the div to get dimensions:

(function (h) {
    // encapsulated variables
    var absolute = 'absolute';

    * override clonerenderto to get the first chart display to fit in a smaller container based on the viewport size
    h.chart.prototype.clonerenderto = function (revert) {
        var clone = this.rendertoclone,
            container = this.container;

        // destroy the clone and bring the container back to the real renderto div
        if (revert) {
            if (clone) {
                delete this.rendertoclone;

            // set up the clone
        } else {
            if (container && container.parentnode === this.renderto) {
                this.renderto.removechild(container); // do not clone this
            this.rendertoclone = clone = this.renderto.clonenode(0);
            h.css(clone, {
                position: absolute,
                top: '-9999px',
                display: 'block' // #833
            if ( { // #2631
      'display', 'block', 'important');

            //sa: constrain cloned element to width of parent element
            if (clone.clientwidth > this.renderto.parentelement.clientwidth){
       = '' + this.renderto.parentelement.clientwidth + 'px';

            if (container) {


i saved this function in a separate script file that loads after the highchart.js script has loaded.


the best way is to call chart.reflow in render event function documentation;

 highcharts.stockchart( 'chartcontainer', {
 chart: {
  events: {
    render: function() {
  zoomtype: 'x',

and remember to set min-width to zero and overflow to hidden in chart container.

#chartcontainter {
  min-width: 0;
  overflow: hidden;


i had a similar issue with centering the highcharts graph it gave. it would center and size correctly for some resolutions but not all. when it didn't, i had the exact same symptoms you're describing here.

i fixed it by attaching/overriding additional css to the highcharts default.

so in a custom css file, adding

/** rules it should follow **/

should fix your issue. assuming that your div "hg=graph" has nothing but highcharts.


for those using angular and custom-built components, remember to define a dimensioned display in css (such as block or flex) for the host element.

and when the chart container has padding, you might find this indispensable:


<chart (load)="saveinstance($event.context)">


  saveinstance(chartinstance: any) {
    this.chart = chartinstance;
    settimeout(() => {
    }, 0);

otherwise the chart will bleed past the container on load and get its correct width only at next browser reflow (eg. when you start to resize window).


define the highcharts inside the document ready:

<div style="width:50%" id="charts">

and the script:


hope it works ;)


set width of the chart. that's the only option that worked for me.

chart: {
            type: 'line',
            width: 835


i have the same problem, in my case had a graph of highchart that it is shown after click a button. i put $(window).resize(); after show event and it solved the problem correctly. i hope you serve.


this works like magic

put in your css file following

.highcharts-container {
    width:100% !important;
    height:100% !important;


to call chart.reflow() helped me. docs:

Related Query

More Query from same tag