【Echarts】map中label增加图标


提示:以下是本篇文章正文内容,下面案例可供参考

一、如何在geo类型的label中增加图标

代码示例,使用rich属性实现

import Icon from '@/assets/images/icon1.png'


	label: {
    
    
	  show: true,
	  color: '#fff',
	  fontSize: 14,
	  opacity: 1,
	  fontFamily: '',
	  backgroundColor: 'rgba(0,0,0,0)',
	  textShadowColor: 'rgba(0, 0, 0, 0.9)',
	  textShadowBlur: 0,
	  textShadowOffsetX: 0,
	  textShadowOffsetY: 2,
	  formatter: '{icon|} {a}',
	  rich: {
    
    
	    icon: {
    
    
	      height: 14,
	      align: 'center',
	      backgroundColor: {
    
    
	        image: Icon
	      }
	    }
	  },
	},

猜你喜欢

转载自blog.csdn.net/qq_33489538/article/details/140373142