mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-17 22:10:11 +00:00
优化清空并重新添加数据后的自动刷新问题
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user