🚀 Gen 5 of the leading AI app deployment platform launches October 6. Click for the livestream.

Cache the chart object

Is it possible to cache a chart object? I can cache its data and render it again, but then I will lose zooming and everything else. Any idea?


var gd = document.getElementById(/* id of your graph div */)

// then
// => gives you your graph's current data array
// => gives you your graph's current layout object

then to really “cache” your data and layout, you’ll need some “extend-deep” utility like


Thanks for the help. Let me sure I understand. I am storing data and layout references into my cache. And when time comes to restore from the cache I am extending the current chart’s data and layout with the these that been cached ? Is that correct?