I am using two (or more) Google charts in a page with Bootstrap tabs. Depending on my tab navigation, the chart lose the size going for a default(?) size. Bellow is a reduced test case with a step to see the problem:
https://jsfiddle.net/73o0rfqe/
How to reproduce:
Situation #1:
- Click Two tab. The chart resizes to the actual size only after the tab click. I am looking for a way render it after page loads (before the tab click).
Situation #2:
- Click Two tab, click TwoC tab, click One tab, click Two tab, click TwoA tab. Now the chart loses the actual size. Click One tab, click Two tab. Now the chart renders with the actual size again.
This part of the code:
$("a[href='#One']").on('shown.bs.tab', function (e) {
google.load('visualization', '1', {packages: ['corechart'], callback: drawChart});
clearChart();
});
I am using to try this, but it is not working like it should. Any help will the helpful.
PS.: Any suggestion on optimizing this code will the helpful too. Thanks.