修复UpdateData接口无法更新数据的问题

This commit is contained in:
monitor1394
2019-08-13 10:20:15 +08:00
committed by GitHub
parent 6c680d0d98
commit ffecdb21ac

View File

@@ -601,7 +601,7 @@ namespace XCharts
/// <param name="value"></param>
public void UpdateYData(int index, float value)
{
UpdateData(index, 2, value);
UpdateData(index, 1, value);
}
/// <summary>
@@ -612,8 +612,8 @@ namespace XCharts
/// <param name="yValue"></param>
public void UpdateXYData(int index, float xValue, float yValue)
{
UpdateData(index, 1, xValue);
UpdateData(index, 2, yValue);
UpdateData(index, 0, xValue);
UpdateData(index, 1, yValue);
}
/// <summary>
@@ -625,11 +625,11 @@ namespace XCharts
public void UpdateData(int index, int dimension, float value)
{
if (index < 0) return;
if (dimension == 1)
if (dimension == 0)
{
if (index < m_XData.Count) m_XData[index] = value;
}
else if (dimension == 2)
else if (dimension == 1)
{
if (index < m_YData.Count) m_YData[index] = value;
}