Closed MartinSchwarzbauer closed 3 years ago
After moving back to menu entry with chart: chart.isChartAttached() returns false! How can i attach it again?
@MartinSchwarzbauer the normal behavior is destroy the chart when the panel container is detached.
But there is a property destroyOnDetach
(default is true
) that you can set which enables do not detach the chart. This property can be set on the options and directly to the chart instance.
LineChart chart = new LineChart();
chart.setDestroyOnDetach(false);
// or
chart.getOptions().setDestroyOnDetach(false);
// or if this behavior is for all charts in the application
Defaults.get().getGlobal().setDestroyOnDetach(false);
Let me know if works.
@MartinSchwarzbauer it's documented here: https://pepstock-org.github.io/Charba-Wiki/docs/defaults/DefaultsCharts#commons-charts-options
Thank you very much! This default behaviour makes sense :)
But I think for Widgets in GWT the behaviour is different !
But I think for Widgets in GWT the behaviour is different !
@MartinSchwarzbauer yeah, it depends on the coder. For instance someone is creating the widget every time, someone like hiding the widgets. The default to false
was thought in order to reduce the amount of memory consumption but allowing the user to decide the different behavior based on use case.
In the Charba showcase for GWT, using UiBinder
, we remove the widget and recreate every time is requested by the user.
Hi *!
I am using latest charba version (master - 4.0) and I have seen the following behaviour:
Thank you very much, Martin