How to make Grid Lines invisible in Android GraphView?
Asked Answered
O

3

5

I just want to show only X Y axes and labels on these axes and don't want to show grid lines in Android GraphView. How can I do that?

Thanks in advance.

Oni answered 7/7, 2015 at 5:13 Comment(2)
if you found out how to do this, I'm really interestedGerger
Any answers for the above questions?Fantast
M
5

I believe the following call should do the trick :

your_graph.getGridLabelRenderer().setGridStyle( GridLabelRenderer.GridStyle.NONE );

Please do note I haven't tested the above call :)

Mitosis answered 10/7, 2015 at 16:29 Comment(3)
this command will also remove both horizontal and vertical axis also :)Oni
Have you tried running this command and then explicitly asking for the X and Y axis to be visible (maybe via your_graph.getGridLabelRenderer().setHighlightZeroLines( true ); or your_graph.getGridLabelRenderer().setVerticalLabelsVisible( true );) ?Mitosis
i created an issue for this topic, will be fixed in future github.com/jjoe64/GraphView/issues/398Cymbre
C
4

If you use this all the grid lines will be Removed

your_graph.getGridLabelRenderer().setGridStyle( GridLabelRenderer.GridStyle.NONE );

For Setting Horizontal Line visible

your_graph.getGridLabelRenderer().setGridStyle(GridLabelRenderer.GridStyle.HORIZONTAL);

For Vertical Line visible

your_graph.getGridLabelRenderer().setGridStyle( GridLabelRenderer.GridStyle.VERTICAL);
Costa answered 4/9, 2017 at 13:44 Comment(0)
L
2

The following code will remove the grid and then show the X and Y axis

graph.getGridLabelRenderer().setGridStyle(GridLabelRenderer.GridStyle.NONE);
graph.getViewport().setDrawBorder(true);
Liana answered 1/8, 2017 at 16:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.