Hi,
This looks like a Plotly resize/reflow issue rather than a problem with your chart data.
Since it renders correctly on the first load and only overflows after navigating back, the underlying Plotly chart is likely not recalculating its dimensions when the page is recreated.
As a quick test, try manually resizing the browser window after returning to the page. If the chart immediately fits the container again, that confirms it's a missing resize/reflow event.
A workaround is to trigger a Plotly resize after the page becomes visible, for example in a JavaScript action:
document.querySelectorAll(".js-plotly-plot").forEach(chart => {
if (chart.offsetParent !== null && typeof Plotly !== "undefined") {
Plotly.Plots.resize(chart);
}
});
window.dispatchEvent(new Event("resize"));
This forces the chart to recalculate its dimensions and fit back into its parent container.
Could you also confirm whether the chart is inside a Data View, Tab Container, or Snippet? That can help narrow down whether it's a visibility/reflow issue.
Kindly mark this as the accepted answer if it helps.
Hello Krishnakummar,
The chart fits the container when I resize the browser but the code you suggested doesn't work to fix the issue.
The cart is inside some containers.