如何在AndroidPlot';什么是XYPlot?

如何在AndroidPlot';什么是XYPlot?,android,androidplot,Android,Androidplot,我想删除此XYPlot图表中的水平线: 我已经尝试过这样做: plot.getGraph().getGridBackgroundPaint().setColor(Color.TRANSPARENT); 并在XYPlot的xml描述中添加了以下内容: ap:rangeLineColor="@color/ap_transparent" 您需要调用这两个方法(删除两条背景线),如果只需要删除水平线,只需调用第二个 //this removes the vertical lines plot.ge

我想删除此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:显然,您可以将不同于
null
的内容作为参数传递,以获得不同的结果。例如,您可以根据需要传递自定义
绘制
对象

这是将两者都设置为
null
的结果:


我能问一下我的答案是否对你有帮助吗?我刚刚测试了
ap:domainLineColor=“@color/ap\u transparent”
ap:rangeLineColor=“@color/ap\u transparent”
,两种方法都有效。我通过删除线图解决了我的问题。setLinesPerRangeLabel(5);由于某些原因,这条线强制范围网格线可见。答案很好,但请确保不要调用plot.setLinesPerRangeLabel(5);