echart坐标轴添加下划线问题

echart坐标轴是不支持HTML标签渲染的,但是项目要求给可点击的坐标轴文字添加标签。下面提供一种曲线求国的方式来实现坐标轴添加下划线需求。

axisLabel:{
    color:'#fff',
	fontSize:16,
	backgroundColor: {
		image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAoCAYAAAAIeF9DAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6Q0MxRDNGODg3RURGMTFFQThCRkNBRDdFREQwRUE5NkYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6Q0MxRDNGODk3RURGMTFFQThCRkNBRDdFREQwRUE5NkYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDQzFEM0Y4NjdFREYxMUVBOEJGQ0FEN0VERDBFQTk2RiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDQzFEM0Y4NzdFREYxMUVBOEJGQ0FEN0VERDBFQTk2RiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pk1P//wAAABfSURBVHja7NvBCQAwCATBJKT/lk/LEJkFG3Dw6U1yNKdnBUAEBIiAABEQIAICREAEBIiAABEQIAICREAEBIiAABEQIAICREAEBIiAABGQtf0eP20uRECACMiCSgABBgAj0gRONrFBJwAAAABJRU5ErkJggg==',
		width:100,
		height:40,
	}
},

通过背景图片的方式来实现这个需求。

你可能感兴趣的:(JavaScript武器库)