import { EleResize } from './ezresize'
import echarts from 'echarts'
export default function drawEcharts(id, option) { // id: chart所在块id， option: 配置项
  const dom = document.getElementById(id)
  const chart = echarts.init(dom)
  chart.setOption(option)
  const listener = _ => {
    chart.resize()
  }
  EleResize.on(dom, listener)
  return chart
}
