How to make Grid Lines invisible in Android GraphView?

落花浮王杯 提交于 2019-12-18 06:13:43

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!