具有延迟加载列表视图的 MPAndroidChart 库

MPAndroidChart library with lazy loading listview

我正在做一个回收器列表视图,它将显示带有延迟加载的图形。当我第一次打开列表时,我显示 10 个项目,然后当我到达列表末尾时,我再加载 5 个项目。

不过,这5个项目加载的晚了,绘制的图形就画得更粗了。我认为它再次借鉴了它。我不知道是什么问题。有人对此有想法吗?

My chart should look like the first position. Then the item that I am lazily loaded is like the second position.

当您加载另外五个条目时,您需要调用以下方法来重新加载您的图表视图:

yourDataSet.notifyDataSetChanged();  // update dataset for new values
chartView.notifyDataSetChanged();   // let the chart know it's data changed
chartView.invalidate();  // refresh the chart

如需进一步查询和解释,请访问:

https://github.com/PhilJay/MPAndroidChart/wiki/Dynamic-&-Realtime-Data