import * as echarts from 'echarts'
import "echarts-gl";
import "echarts/lib/chart/bar"
export function setOptions(ele,options){
    let myEchart = echarts.init(ele);
    myEchart.setOption({
        ...options,
    })
	/* console.log('到这了')
	console.log('ele')
	console.log(ele)
	console.log('options')
	console.log(options) */
    myEchart.resize({
        width:myEchart._dom.clientWidth,
        height:myEchart._dom.clientHeight
    })
    window.addEventListener('resize',()=>{
        myEchart.resize({
            width:myEchart._dom.clientWidth,
            height:myEchart._dom.clientHeight
        })
    })
    return myEchart
}