So this is a bit old, but for anyone stumbling across this, I was having a similar issue with the highchart sizes being incorrect in a bootstrap tabbed display. The solution I came up with was to just delay creating the chart by 100ms using setTimeout().

setTimeout(function() {
}, 100);

Note: drawBarChart is a custom function I created to generate the charts I needed. The issue (at least in my case) seemed to be that the chart was being created before (or at the same time) as the container and was therefore choosing some default width instead of the width of the container.


I have 2 tabs , met same problem. I changed only 2 rows codes of Druska, and it worked.

function anyname() {
$("[data-highcharts-chart]").each(function () {
var highChart = Highcharts.charts[$(this).data('highchartsChart')];
var highChartCont = $(highChart.container).parent();



and add one onclick event to you HTML tab codes like below:

   <input type="radio" id="tab1_1" checked  onclick="anyname();" >


i fix this problem with the next code.

            chart: {
                type: data.EjeX.Tipo,
                //width: width,
                //height: height,
                options3d: {
                    enabled: true,
                    alpha: 15,
                    beta: 15,
                    viewDistance: 25,
                    depth: 40
                width: $('#DivContainerWithYourTabs').width() - 150

in my case is a partial "_partialDetalleProyecto"

I hope works you.


I had a similar issue and I found that the best thing was not to load the chart until the tab was shown. So in the tab shown event I was quickly loading the chart (but only once)


I just solved this issue with the following. Using bootstrap version 3.3.5

I am leaving this here because this link showed up when I googled the issue at the beginning. I hope it helps.

$('a[data-toggle="tab"]').on('', function (e) {


<!-- Nav tabs -->
<ul class="nav nav-pills nav-justified" role="tablist" id="taks-tabs">
    <li role="presentation" class="active"><a href="#taks_met_std" aria-controls="taks_met_std" role="tab" data-toggle="tab">Met Standard</a></li>
    <li role="presentation"><a href="#taks_comm_perf" aria-controls="taks_comm_perf" role="tab" data-toggle="tab">Commended Performance</a></li>
    <li role="presentation"><a href="#taks_m_met_std" aria-controls="taks_m_met_std" role="tab" data-toggle="tab">TAKS-M Met Standard</a></li>

<!-- Tab panes -->
<div class="tab-content">
    <div role="tabpanel" class="tab-pane active" id="taks_met_std"></div>
    <div role="tabpanel" class="tab-pane" id="taks_comm_perf"></div>
    <div role="tabpanel" class="tab-pane" id="taks_m_met_std"></div> 


add class="chart" to all highcharts containers inside tabs.

add this jQuery code:

jQuery(document).on( '', 'a[data-toggle="tab"]', function () { 
    $( '.chart' ).each(function() { 


I found the answer after looking for sometime. This was driving me crazy so I want to share it with you all since nothing here worked for me.

Add this to your CSS

.tab-content > .tab-pane,
.pill-content > .pill-pane {
    display: block;     
    height: 0;          
    overflow-y: hidden; 

.tab-content > .active,
.pill-content > .active {
    height: auto;       

For more details visit the page I found the solution at


This is my fix for this (using jQuery):

$("[data-highcharts-chart]").each(function () {
    var highChart = Highcharts.charts[$(this).data('highchartsChart')];
    var highChartCont = $(highChart.container).parent();
    highChart.setSize(highChartCont.width(), highChartCont.height());
    highChart.hasUserSize = undefined;

Call this function whenever the chart gains focus to make sure it is resized properly.


Here is a working example:

Basically the .reflow() function is called on each chart when a tab is clicked. That way the chart gets redrawn based on the new dimensions which are applied to the container when it becomes visible.

This is the most important snippet of code:

// fix dimensions of chart that was in a hidden element
jQuery(document).on( '', 'a[data-toggle="tab"]', function (e) { // on tab selection event
    jQuery( ".contains-chart" ).each(function() { // target each element with the .contains-chart class
        var chart = jQuery(this).highcharts(); // target the chart itself
        chart.reflow() // reflow that chart

Related Query

More Query from same tag