echarts 餅圖的指示線(labelline) 問題


數據過多,且幾個比較小的數據在一塊扎堆

例如:


*解決方法: *

series: [
						{
							name: '',
							type: 'pie',
							center: ["25%", "50%"],
							radius: ['45%', '60%'],
							minAngle: 10,  // 設置每塊扇形的最小占比
							avoidLabelOverlap: false,
							hoverAnimation: false,
							silent: true,
							label: {
								normal: {
									show: true,
									formatter: "{d}% ",
									textStyle: {
										fontSize: this.standSize / 150,
										color: "#fff"
									},
								},
							},
							labelLine: {
								normal: {
									lineStyle: {
										color: 'rgba(255, 255, 255, 0.3)'
									},
									smooth: 0.2,
									length: this.standSize / 50,
									length2: this.standSize / 100,
								}
							},
							data: data
						}
					],

本段代碼是在vue實例中寫的,standSize在data中已定義standSize: document.body.clientWidth

*修改后如下: *


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM