Echarts x axis disposed perpendicular to display text, display or display omitted inclined

Vertical display:

let option = {
	xAxis:{
		//文字样式
		axisLabel: {
             show: true,                               
             textStyle: {
                color: '#595C61'
             },
             formatter:function(value){
				return value.split("").join("\n");
			 }
        }
	}
}

Here Insert Picture Description

Tilt the display:

let option = {
	xAxis:{
		//文字样式
		axisLabel: {
             show: true,                               
             textStyle: {
                color: '#595C61'
             },
             rotate:45
        }
	}
}

Here Insert Picture Description

Omission display:

let option = {
	xAxis:{
		//文字样式
		axisLabel: {
             show: true,                               
             textStyle: {
                color: '#595C61'
             },
             formatter:function(value){
				 if(value.length > 6){
                        return `${value.slice(0,4)}...`;
                 }
                 return value;
			 }
        }
	}
}

Here Insert Picture Description

Published 258 original articles · won praise 21 · views 50000 +

Guess you like

Origin blog.csdn.net/wsln_123456/article/details/104471691