增加TooltipalwayShow参数设置触发后一直显示

This commit is contained in:
monitor1394
2020-06-04 07:46:07 +08:00
parent 6590b70db6
commit 384c6a842e
3 changed files with 8 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
# 更新日志
* (2020.06.04) 增加`Tooltip``alwayShow`参数设置触发后一直显示
* (2020.06.04) 优化`Tooltip``formatter`支持`{.1}`通配符
* (2020.06.04) 优化`Legend`数量过多时自动换行显示
* (2020.06.03) 发布`v1.5.1`版本

View File

@@ -217,6 +217,7 @@
* `paddingTopBottom`:文字和边框的上下边距。
* `backgroundImage`:提示框的背景图。
* `ignoreDataDefaultContent`:被忽略数据的默认显示字符信息。
* `alwayShow`:是否触发后一直显示。
* `lineStyle`:指示器线条样式 [LineStyle](#LineStyle)。
* `textStyle`:显示内容文本样式 [TextStyle](#TextStyle)。

View File

@@ -63,6 +63,7 @@ namespace XCharts
[SerializeField] private float m_PaddingLeftRight = 5f;
[SerializeField] private float m_PaddingTopBottom = 5f;
[SerializeField] private string m_IgnoreDataDefaultContent = "-";
[SerializeField] private bool m_AlwayShow = true;
[SerializeField] private Sprite m_BackgroundImage;
[SerializeField] private TextStyle m_TextStyle = new TextStyle(18, FontStyle.Normal);
[SerializeField] private LineStyle m_LineStyle = new LineStyle(LineStyle.Type.Solid, 0.7f);
@@ -170,6 +171,10 @@ namespace XCharts
/// </summary>
public Sprite backgroundImage { get { return m_BackgroundImage; } set { m_BackgroundImage = value; SetBackground(m_BackgroundImage); } }
/// <summary>
/// 是否触发后一直显示。
/// </summary>
public bool alwayShow { get { return m_AlwayShow; } set { m_AlwayShow = value; } }
/// <summary>
/// 提示框内容文本样式。
/// </summary>
public TextStyle textStyle
@@ -383,6 +388,7 @@ namespace XCharts
/// <param name="flag"></param>
public void SetActive(bool flag)
{
if(!flag && m_AlwayShow) return;
lastDataIndex[0] = lastDataIndex[1] = -1;
if (m_GameObject && m_GameObject.activeInHierarchy != flag)
m_GameObject.SetActive(flag);