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
结果图