diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index 6440c8a8..630e3c65 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -69,6 +69,7 @@ slug: /changelog ## master +* (2023.10.19) 修复`Pie`设置玫瑰图时引导线异常的问题 * (2023.10.15) 修复`Line`设置`Animation`为`AlongPath`时动画异常的问题 (#281) * (2023.10.12) 修复`MarkLine`指定`yValue`时对数值轴无效的问题 * (2023.10.11) 修复`Serie`的`showDataDimension`设置无效的问题 diff --git a/Runtime/Serie/Pie/PieHandler.cs b/Runtime/Serie/Pie/PieHandler.cs index 00fa2b43..76a7cded 100644 --- a/Runtime/Serie/Pie/PieHandler.cs +++ b/Runtime/Serie/Pie/PieHandler.cs @@ -464,10 +464,11 @@ namespace XCharts.Runtime var rad = Mathf.Deg2Rad * serieData.context.halfAngle; var lineLength1 = ChartHelper.GetActualValue(labelLine.lineLength1, serie.context.outsideRadius); var lineLength2 = ChartHelper.GetActualValue(labelLine.lineLength2, serie.context.outsideRadius); + var radius = lineLength1 + serie.context.outsideRadius - serieData.context.outsideRadius; var pos1 = startPosition; - var pos2 = pos1 + new Vector3(Mathf.Sin(rad) * lineLength1, Mathf.Cos(rad) * lineLength1); + var pos2 = pos1 + new Vector3(Mathf.Sin(rad) * radius, Mathf.Cos(rad) * radius); var pos5 = labelLine.lineType == LabelLine.LineType.HorizontalLine - ? pos1 + dire * (lineLength1 + lineLength2) + labelLine.GetEndSymbolOffset() + ? pos1 + dire * (radius + lineLength2) + labelLine.GetEndSymbolOffset() : pos2 + dire * lineLength2 + labelLine.GetEndSymbolOffset(); if (labelLine.lineEndX != 0) {