// 基于准备好的dom,初始化echarts实例
let myChart = echarts.init(document.getElementById('mapEcharts'))
// 绘制图表
myChart.setOption(this.getOptions)
// 默认高亮
myChart.dispatchAction({
type: 'geoSelect',
name:'山西'
})
// 默认显示toollip
myChart.dispatchAction({
type: 'showTip',
seriesIndex:0 ,//第几条series
dataIndex: 0,//显示第几个tooltip
})
//图表文字自适应
window.addEventListener("resize", () => {
this.windowCliW = document.body.clientWidth;
myChart.setOption(this.getOptions);
myChart.resize();
});
echarts map地图默认显示高亮和tooltip
最新推荐文章于 2025-04-10 19:16:35 发布