myChart.setOption(option); /*window.addEventListener("resize", function () { myChart.resize(); });*/ window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", acrossOrVertical, false); function acrossOrVertical() { if (window.orientation == 180 || window.orientation == 0) { myChart.resize(); } if (window.orientation == 90 || window.orientation == -90) { myChart.resize(); } } acrossOrVertical()
Done!