XCharts-Team / XCharts

A charting and data visualization library for Unity. Unity数据可视化图表插件。
https://xcharts-team.github.io
MIT License
3.31k stars 571 forks source link

Problem of maxCache #335

Closed lyylsh closed 2 hours ago

lyylsh commented 12 hours ago

When I use Chart.SetMaxCache() for line chart. I found that the data will not change dynamically after reaching the value set by maxcache.How can I deal with it. Thank u.

monitor1394 commented 12 hours ago

How did you add the data? Could you show the relevant code?

lyylsh commented 10 hours ago

How did you add the data? Could you show the relevant code? Just like this. Implemented in a loop within a thread.

eyeQueue.TryDequeue(out eyeData); dataChart.AddXAxisData("x" + cnt); dataChart.AddData(0, eyeData);

0a140c9864b87fce0137ae1d6757dd0

monitor1394 commented 9 hours ago

The code seems fine. If you called dataChart.SetMaxCache before StartServer, it should work as expected. Could you provide more details? What version of XCharts are you using?

lyylsh commented 9 hours ago

The code seems fine. If you called dataChart.SetMaxCache before StartServer, it should work as expected. Could you provide more details? What version of XCharts are you using?

I've just realized that it may have been an issue due to the ignore break I had set, I kept updating the index of the x-axis causing the array to go out of bounds. It's fixed now, thanks.