gpt4 book ai didi

java - 在 GraphView 中的图形和刻度标签之间添加空格?

转载 作者:行者123 更新时间:2023-12-01 18:18:42 26 4
gpt4 key购买 nike

我正在尝试 GraphView Library用于在 Android 上创建图表。它看起来相当不错,但我想知道是否有办法在刻度标签和图表本身之间添加一些空间。正如你所看到的,基本上没有:

enter image description here

我使用以下代码来设置图表(与 example 非常相似):

GraphView graph = (GraphView)view.findViewById(R.id.graph);
LineGraphSeries<DataPoint> series = new LineGraphSeries<DataPoint>(new DataPoint[] {
new DataPoint(0, 1),
new DataPoint(1, 5),
new DataPoint(2, 3)
});
graph.addSeries(series);

我尝试使用graph.getGridLabelRenderer().setPadding(),但这只是在整个图表周围添加了填充。

那么,有没有办法在这些标签周围添加一些填充?

最佳答案

是的,在 github 的当前版本中是可能的(将在 4.0.1 中发布)。有方法:

graph.getGridLabelRenderer().setLabelsSpace(x)

关于java - 在 GraphView 中的图形和刻度标签之间添加空格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28183486/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com