When calling setData, only destroy the visualisation if the type has changed.