mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-19 23:10:06 +00:00
整理显示10000数据的demo
This commit is contained in:
@@ -20,22 +20,24 @@ public class Demo_LargeData : MonoBehaviour
|
||||
timeNow = System.DateTime.Now;
|
||||
chart.ClearAxisData();
|
||||
chart.series.ClearData();
|
||||
chart.maxCacheDataNumber = maxCacheDataNumber;
|
||||
timeNow = timeNow.AddSeconds(-maxCacheDataNumber);
|
||||
chart.maxCacheDataNumber = 0;
|
||||
chart.title.text = maxCacheDataNumber + "数据";
|
||||
}
|
||||
|
||||
void Update()
|
||||
private void Update()
|
||||
{
|
||||
if (initCount < maxCacheDataNumber)
|
||||
{
|
||||
int count = (int)(maxCacheDataNumber / initDataTime * Time.deltaTime);
|
||||
for (int i = 0; i < count; i++)
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
timeNow = timeNow.AddSeconds(1);
|
||||
chart.AddXAxisData(timeNow.ToString("hh:mm:ss"));
|
||||
chart.AddData(0, UnityEngine.Random.Range(60, 150));
|
||||
initCount++;
|
||||
if (initCount > maxCacheDataNumber) break;
|
||||
chart.title.text = initCount+"数据";
|
||||
timeNow = timeNow.AddSeconds(1);
|
||||
float xvalue = Mathf.PI / 180 * initCount;
|
||||
float yvalue = Mathf.Sin(xvalue);
|
||||
chart.AddData(0, 15 + yvalue * 2);
|
||||
chart.AddXAxisData(timeNow.ToString("hh:mm:ss"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -81,7 +81,6 @@ namespace XCharts
|
||||
/// <param name="height">height</param>
|
||||
public virtual void SetSize(float width, float height)
|
||||
{
|
||||
Debug.LogError("setsize:" + m_CheckWidth + "," + m_CheckHeight + "," + width + height);
|
||||
m_ChartWidth = width;
|
||||
m_ChartHeight = height;
|
||||
m_CheckWidth = width;
|
||||
|
||||
Reference in New Issue
Block a user