0
任何人都可以請幫我解決這個問題,也就是說,我試圖用單個LineAndPointFormatter使用android plot繪製一個多色圖。根據範圍值LineAndPointFormatter顏色將會改變,即假設範圍值在0-50之間,那麼線顏色將是藍色,如果範圍值在50-100,那麼顏色將是綠色,如果範圍值在100-200,那麼顏色將是黑色和100以上它將是灰色的。AndroidPlot多色LineAndPointFormatter
Check and let me know if below solution is fine or not i.e.
LineAndPointFormatter formatter;
formatter = new LineAndPointFormatter(Color.rgb(50, 143, 222),
null, null, null);
Paint paint = formatter.getLinePaint();
paint.setStrokeWidth(10); // Set the formatter width
paint.setColor(Color.BLUE); // Set the formatter color
formatter.setLinePaint(paint);
但現在面臨的問題是如何獲得的數值範圍,改變顏色,如果不知何故,我會得到的範圍值,則相應地,我可以改變使用paint.setColor(Color.BLUE)的顏色;
讓我知道是否有解決方案。