java - AndroidPlot: Adding and Removing XYSeries -
i'm having problem implementation:
if(blueactive) { blueformat = new lineandpointformatter(color.rgb(0,0,255), null, null); blue = new simplexyseries(xarray,yarray, selecteddate); log.e(tag , "blueactive"); cvplot.addseries(blue, blueformat); } if(redactive) { redformat = new lineandpointformatter(color.rgb(255,0,0), null, null); red = new simplexyseries(xarray,yarray, selecteddate); log.e(tag , "redactive"); cvplot.addseries(red, redformat); } if(greenactive) { greenformat = new lineandpointformatter(color.rgb(0,255,0), null, null); green = new simplexyseries(xarray,yarray, selecteddate); log.e(tag , "greenactive"); cvplot.addseries(green, greenformat); } cvplot.redraw();
the series plotted correct xarray , yarray, when graph redraws, plots same color. i'm looking code redraw plot 3 different colors. doing logically wrong here?
although question wasn't descriptive other code involved, answer add onclick started process of adding plots:
xarray.clear(); yarray.clear();
the lines overlapping, , when next color added, since red plot selected after blue, 2 arrays grew include points of blue , red, making color wasn't changing. in other words, red array included blue array, , since points identical blue plot, couldn't see blue plot since red plot on top!
i had set log.d long before problem didn't notice array doubling since didn't log count because wanted see x , y values populating.
log array counts , clear arrays rook dawg!!
Comments
Post a Comment