I had the same issue and my solution was to add a DataView with a "TabHelperNP" entity with member "TabIndex" around the tabcontainer. This entity is then referenced for the tabcontainer "attribute" you can find in the tabcontainer settings which will always contain the current index of the tab selected starting by 1.
I also added an OnChange nanoflow with the TabHelperNP parameter to the tabcontainer which based on the TabIndex (for the tabs including charts) is executing a Javascript to resize the pltotly chart.
With this it always resize and looks as it should.
The user code for the JS is:
document.querySelectorAll(".js-plotly-plot").forEach(chart => {
if (chart.offsetParent !== null && typeof Plotly !== "undefined") {
Plotly.Plots.resize(chart);
}
});
window.dispatchEvent(new Event("resize"));