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

This commit is contained in:
monitor1394
2019-08-13 10:20:15 +08:00
committed by GitHub
parent 96e2255960
commit f881a0cedd

View File

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