大家好:我目前正在将 GraphView 库集成到我的 android 项目中。我想知道是否可以调整网格的大小。另外,标签大小可以更改吗?这些数字非常小,难以阅读。提前非常感谢!
user1939358
问问题
5014 次
2 回答
2
您可以使用以下代码更改标签大小
//setting the minimum and maximum values for x and y axis
graph.getViewport().setXAxisBoundsManual(true);
graph.getViewport().setMinX(0);
graph.getViewport().setMaxX(12);
graph.getViewport().setYAxisBoundsManual(true);
graph.getViewport().setMinY(0);
graph.getViewport().setMaxY(6);
//number of labels on x nd y axis
graph.getGridLabelRenderer().setNumHorizontalLabels(7);
graph.getGridLabelRenderer().setNumVerticalLabels(7);
于 2016-02-18T06:38:13.790 回答
0
您需要修改源代码。从 github 克隆它并将其用作 Android 库。
代码真的很容易理解。例如要更改标签大小/颜色/更多,只需在此处修改: https ://github.com/jjoe64/GraphView/blob/master/src/com/jjoe64/graphview/GraphView.java#L213
祝你好运
于 2013-01-15T07:27:32.247 回答