Echarts x-Achse, die senkrecht zu Text, Display oder die Anzeige angezeigt werden weggelassen geneigt

Vertikale Anzeige:

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

Hier hat Bild einfügen Beschreibung

Kippen Sie das Display:

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

Hier hat Bild einfügen Beschreibung

Auslassung Anzeige:

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

Hier hat Bild einfügen Beschreibung

Veröffentlicht 258 Originalarbeiten · erntete Lob 21 · Ansichten 50000 +

Ich denke du magst

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