netpork netpork - 1 year ago 164
Android Question

androidplot - how can I empty SimpleXYSeries

i presume it is pretty basic, but I can't find the solution.
I have something like this:

public SimpleXYSeries historySeries;
historySeries = new SimpleXYSeries("something");

then in background thread I add some data to the series:

historySeries.addLast(newRoll, newAzimuth);

Question is, how can I easily just remove all the data entries from the series, when needed?

Right now I have something like:

public void initSeries() {
historySeries = null;
historySeries = new SimpleXYSeries("something");
historyPlot.addSeries(historySeries, lpf);

It works, but graph flickers when I do addSeries again.


I have resolved the issue by making my own version of SimpleXYSeries and added a method:

public void removeXY() {
try {
} finally {

Answer Source

I have always used clear() to remove the plot and never had the graph flicker. Are you trying this on just an emulator or also on a real device?

I also found these method:


I am not sure if it will be any better for a flicker

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download