我对这个实现有问题:
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();
该系列使用正确的 xArray 和 yArray 绘制,但是当图形重绘时,所有图都是相同的颜色。我正在寻找这段代码来用三种不同的颜色重新绘制绘图。我在这里做一些逻辑错误的事情吗?