优化清空并重新添加数据后的自动刷新问题

This commit is contained in:
monitor1394
2020-03-11 08:41:42 +08:00
parent cb86799e44
commit 4606d65a5c
7 changed files with 29 additions and 8 deletions

View File

@@ -830,6 +830,7 @@ namespace XCharts
if (m_RuntimeMinValue == 0 && m_RuntimeMaxValue == 0) return 0;
if (!m_RuntimeMinValueChanged) return m_RuntimeMinValue;
var time = Time.time - m_RuntimeMinValueUpdateTime;
if (time == 0) return m_RuntimeMinValue;
var total = duration / 1000;
if (duration > 0 && time <= total)
{
@@ -849,8 +850,9 @@ namespace XCharts
if (m_RuntimeMinValue == 0 && m_RuntimeMaxValue == 0) return 0;
if (!m_RuntimeMaxValueChanged) return m_RuntimeMaxValue;
var time = Time.time - m_RuntimeMaxValueUpdateTime;
if (time == 0) return m_RuntimeMaxValue;
var total = duration / 1000;
if (duration > 0 && time <= total)
if (duration > 0 && time < total)
{
var curr = Mathf.Lerp(m_RuntimeLastMaxValue, m_RuntimeMaxValue, time / total);
return curr;

View File

@@ -1561,6 +1561,15 @@ namespace XCharts
return m_Ignore && Mathf.Approximately(value, m_IgnoreValue);
}
public bool IsIngorePoint(int index)
{
if (index >= 0 && index < dataPoints.Count)
{
return ChartHelper.IsIngore(dataPoints[index]);
}
return false;
}
/// <summary>
/// 更新运行时中心点和半径
/// </summary>

View File

@@ -125,7 +125,7 @@ namespace XCharts
/// </summary>
public void ClearData()
{
AnimationPause();
AnimationFadeIn();
foreach (var serie in m_Series)
{
serie.ClearData();
@@ -326,7 +326,7 @@ namespace XCharts
/// </summary>
public void RemoveAll()
{
AnimationPause();
AnimationFadeIn();
m_Series.Clear();
}