Keeping text in the middle while zooming


With plotly.js and with the following attributes in the trace, I can put the text in the middle of the bars.

            textposition: "auto",
            insidetextanchor: "middle",

But I want to keep the text in middle when I am showing some part of the bar. For example, when I zoom in the chart, text disappears if i zoom somewhere else than the middle of the bar.

Is there a way to keep text in the middle of bar that is in the current view?