score:5

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('shown.bs.modal', function (event) {
  $.getjson(http://whatever.com/file.js, 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

score:0

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

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

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

this is the loading the graph


Related Query

More Query from same tag