ECharts: How to use the resize event of the window?

Lolo picture Lolo · Jan 6, 2015 · Viewed 17k times · Source

Im trying the Echarts library for my graphs. I'd like to resize the plots when the window's resize trigger is fired but I can't find the way to do it.

Thanx for your help

Answer

maralla picture maralla · Jan 6, 2015
var plot = echarts.init(yourDom);
plot.setOption({...});
window.onresize = function() {
  plot.resize();
};