let num = data.length // x軸的數量
window.onresize = this['chart' + index].resize
let autoHeight = num * 50 + 100
this['chart' + index].getDom().style.height = autoHeight + 'px'
this['chart' + index].getDom().childNodes[0].style.height = autoHeight + 'px'
this['chart' + index].resize()
注:this['chart' + index] 爲生成圖表的dom元素。例: 元素的id爲 chart1
結果圖