增加BarrealtimeSort支持实时排序

This commit is contained in:
monitor1394
2025-03-01 22:30:51 +08:00
parent 063b5529d7
commit ffed67d8ee
16 changed files with 143 additions and 61 deletions

View File

@@ -37,6 +37,7 @@ namespace XCharts.Runtime
label.SetActive(comment.show && item.show, true);
label.SetPosition(labelPos);
label.text.SetLocalPosition(labelStyle.offset);
item.labelObject = label;
}
};
comment.refreshComponent();

View File

@@ -15,7 +15,9 @@ namespace XCharts.Runtime
[SerializeField] private Rect m_MarkRect;
[SerializeField] private CommentMarkStyle m_MarkStyle = new CommentMarkStyle() { show = false };
[SerializeField] private LabelStyle m_LabelStyle = new LabelStyle() { show = false };
[SerializeField] [Since("v3.5.0")]private Location m_Location = new Location() { align = Location.Align.TopLeft, top = 0.125f };
[SerializeField][Since("v3.5.0")] private Location m_Location = new Location() { align = Location.Align.TopLeft, top = 0.125f };
public ChartLabel labelObject { get; set; }
/// <summary>
@@ -27,7 +29,18 @@ namespace XCharts.Runtime
/// content of comment.
/// ||注解的文本内容。支持模板参数可以参考Tooltip的itemFormatter。
/// </summary>
public string content { get { return m_Content; } set { if (PropertyUtil.SetClass(ref m_Content, value)) SetComponentDirty(); } }
public string content
{
get { return m_Content; }
set
{
if (PropertyUtil.SetClass(ref m_Content, value))
{
if (labelObject != null) labelObject.SetText(value);
else SetComponentDirty();
}
}
}
/// <summary>
/// the mark rect of comment.
/// ||注解区域。