mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-14 20:00:09 +00:00
增加PolarCood的indicatorLabelOffset设置指示文本偏移的支持
This commit is contained in:
@@ -66,6 +66,7 @@ slug: /changelog
|
||||
|
||||
## master
|
||||
|
||||
* (2023.06.30) 增加`PolarCood`的`indicatorLabelOffset`设置指示文本偏移的支持
|
||||
* (2023.06.30) 修复`Axis`的`IndicatorLabel`的背景颜色可能不正常的问题
|
||||
* (2023.06.30) 增加`Axis`的`IndicatorLabel`可自定义`color`的支持
|
||||
* (2023.06.12) 修复`AxisLabel`的`formatterFunction`在数值轴时`value`不对的问题
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace XCharts.Editor
|
||||
PropertyTwoFiled("m_Center");
|
||||
PropertyTwoFiled("m_Radius");
|
||||
PropertyField("m_BackgroundColor");
|
||||
PropertyField("m_IndicatorLabelOffset");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ namespace XCharts.Runtime
|
||||
var dir = (chart.pointerPos - new Vector2(polar.context.center.x, polar.context.center.y)).normalized;
|
||||
var angle = ChartHelper.GetAngle360(Vector2.up, dir);
|
||||
axis.context.pointerValue = (angle - component.context.startAngle + 360) % 360;
|
||||
axis.context.pointerLabelPosition = polar.context.center + new Vector3(dir.x, dir.y) * (polar.context.outsideRadius + 25);
|
||||
axis.context.pointerLabelPosition = polar.context.center + new Vector3(dir.x, dir.y) * (polar.context.outsideRadius + polar.indicatorLabelOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,9 +57,10 @@ namespace XCharts.Runtime
|
||||
if (com is Axis)
|
||||
{
|
||||
var axis = com as Axis;
|
||||
var aligment = (com is AngleAxis) ? TextAnchor.MiddleCenter : axis.context.aligment;
|
||||
var labelName = ChartCached.GetComponentObjectName(axis);
|
||||
var item = ChartHelper.AddTooltipIndicatorLabel(component, labelName, m_LabelRoot.transform,
|
||||
chart.theme, axis.context.aligment, axis.indicatorLabel);
|
||||
chart.theme, aligment, axis.indicatorLabel);
|
||||
item.SetActive(false);
|
||||
m_IndicatorLabels[labelName] = item;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user