我想从此 XYPlot 图表中删除水平线:
我已经尝试这样做了:
plot.getGraph().getGridBackgroundPaint().setColor(Color.TRANSPARENT);
并在 XYPlot 的 xml 描述中添加:
ap:rangeLineColor="@color/ap_transparent"
最佳答案
你需要的是调用这两个方法(删除两个背景线),如果你只需要删除水平线就调用第二个。
//this removes the vertical lines
plot.getGraph().setDomainGridLinePaint(null)
//this removes the horizontal lines
plot.getGraph().setRangeGridLinePaint(null)
PS: Obviously you can pass as parameter something different than
null
to get different results. For example you can pass a customPaint
object based on your needs.
这是将两者都设置为 null
的结果:
关于android - 如何在 AndroidPlot 的 XYPlot 上隐藏水平范围线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48620565/