I am trying to incorporate Android GraphView
project into my app and all the time I have some strange problem with it.
My app requires drawing graph from real time data. I have thread with all the communication that is providing the data. In main thread I am reading this data and simply use mSeries1.appendData(new DataPoint(counter,data[0]),true,100);
where counter is int that is incremented after each update.
Unfortunately at some point it freeze. I've tried putting it in synchronized
block or changing the line of code to mSeries1.appendData(new DataPoint(counter,counter),true,100);
and still this same result.
This is how the memory looks like during app running and when it freezes:
Does anyone have any idea what might be wrong in here?
EDIT:
This is my current method for updating my graph view:
public void onEventMainThread(ReadingsUpdateData data) {
mSeries1.appendData(new DataPoint(counter,data.getData()[0]),true,100);
counter++;
}
DataPoint
objects. – Sidonnie