问题
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.
回答1:
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 :)
回答2:
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);
回答3:
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);
来源:https://stackoverflow.com/questions/31260218/how-to-make-grid-lines-invisible-in-android-graphview