Accepted answer

in my case i was using chartjs inside a bootstrap tab inside a bootstrap modal. the problem in my case was the modal, and not the tab. the code related with chartjs has to be set into

$('#modal').on('', function (event) {
  $.getjson(, function( data ) {
    var ctx = document.getelementbyid("heightchart").getcontext("2d");
    window.mynewchart = new chart(ctx).stackedbar(data,  {
      responsive : true,
      animation: true,
      showscale: true,
      multitooltiptemplate: "<%= datasetlabel %> - <%= value %>"


i have found a hint on this other issue: bootstrap modal with chart.js linechart


the panels accessed by the tabbed panes defined should have the attribute active:

  <li role="presentation" class="active col-sm-3">
    <a href="#tab3primary" data-toggle="tab">sample</a>

<div class="tab-pane fade in active" id="tab3primary"> 
  <canvas>---displays the image here ---</canvas>

this is the loading the graph

Related Query

More Query from same tag