Home Forums Chart Support Canvas JS chart not displayed properly in Bootstrap tabs

Canvas JS chart not displayed properly in Bootstrap tabs

Viewing 2 posts - 1 through 2 (of 2 total)
  • #9829

    I’m using bootstrap tab to show monthly and weekly charts. Chart load properly in first tab when I select second tab chart don’t fit into col-md-3. How to fix this error?
    http://codepen.io/rajumax/pen/LGQoRN

    I’m using bootstrap tab to show monthly and weekly charts. Chart load properly in first tab when I select second tab chart don’t fit into col-md-3. How to fix this error?
    http://codepen.io/rajumax/pen/LGQoRN

    #9830

    Rajrs,

    CanvasJS Chart automatically sets the height and width of the chart according to container’s dimensions. If the values are not set for the container, it takes the default values.

    In bootstrap, since the second tab is not displayed initially, chart takes the default values. To solve this issue, second chart is rendered when the shown.bs.tab event is fired by bootstrap.

    Here is the working code for the same.
    chart within bootstrap tab


    Vishwas R
    Team CanvasJS

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.