mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-23 01:10:08 +00:00
v2.2.2
This commit is contained in:
@@ -12,6 +12,7 @@ namespace XCharts
|
||||
{
|
||||
public class ChartLabel : ChartObject
|
||||
{
|
||||
private bool m_EmptyStringHideIcon = false;
|
||||
private bool m_LabelAutoSize = true;
|
||||
private float m_LabelPaddingLeftRight = 3f;
|
||||
private float m_LabelPaddingTopBottom = 3f;
|
||||
@@ -48,6 +49,8 @@ namespace XCharts
|
||||
}
|
||||
}
|
||||
|
||||
public bool emptyStringHideIcon { set { m_EmptyStringHideIcon = value; } }
|
||||
|
||||
public ChartLabel()
|
||||
{
|
||||
}
|
||||
@@ -179,6 +182,10 @@ namespace XCharts
|
||||
return sizeChange;
|
||||
}
|
||||
AdjustIconPos();
|
||||
if (m_EmptyStringHideIcon)
|
||||
{
|
||||
ChartHelper.SetActive(m_IconImage.gameObject, !string.IsNullOrEmpty(text));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -405,6 +405,7 @@ namespace XCharts
|
||||
var textStyle = axis.axisLabel.textStyle;
|
||||
var iconStyle = axis.iconStyle;
|
||||
var label = new ChartLabel();
|
||||
label.emptyStringHideIcon = true;
|
||||
label.gameObject = AddObject(name, parent, anchorMin, anchorMax, pivot, sizeDelta);
|
||||
|
||||
// TODO: 为了兼容旧版本,这里后面版本可以去掉
|
||||
|
||||
Reference in New Issue
Block a user