I'd like to remove the horizontal lines from this XYPlot chart:
I've already tried doing this:
plot.getGraph().getGridBackgroundPaint().setColor(Color.TRANSPARENT);
and added this in the XYPlot's xml description:
ap:rangeLineColor="@color/ap_transparent"
What you need is to call those two methods (to remove both background lines), if you need to remove only the horizontal ones just call the second one.
//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.
This is the result with both set to null
: