Prevent Chart Refresh on Tab Change - Vaadin 7 Charts

Hello,
I have a tabsheet with a chart in one tab. Is there a way to prevent or stop the chart from refreshing back to it’s original state when switching between the tabs? I am using a timeline chart, and I would like for the chart to retain it’s zoom state.

Vaadin 7.5.10, Charts 3.2.0

Thank you.

No, you can’t prevent that happening, since TabSheet is not retaining tab content in client side (in order to conserve Browser memory consumption). However you can use [addSelectedTabChangeListener]
(https://vaadin.com/download/release/7.7/7.7.13/docs/api/com/vaadin/ui/TabSheet.html#addSelectedTabChangeListener-com.vaadin.ui.TabSheet.SelectedTabChangeListener-) and maintain zoom state in your class, so that you can set it back upon tab change.

OK, thanks so much. That was my backup plan, and it works fine.

chart.getConfiguration().getxAxis().setExtremes(eventDateMin, eventDateMax);
chart.drawChart();