在GraphView图和刻度标记之间添加空间? [英] Add space between graph and tick labels in GraphView?

查看:452
本文介绍了在GraphView图和刻度标记之间添加空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想出来的 GraphView库在Android上创建图表。它看起来相当不错,但我想知道如果有一种方法来添加刻度标记和图形本身之间的一些空间。正如你所看到的,基本上是没有了:

I am trying out the GraphView Library for creating charts on Android. It looks quite decent, but I am wondering if there is a way to add some space between the tick labels and the graph itself. As you can see, there is basically none:

我用下面的code设置图表(非常类似的例如):

I use the following code to set up the graph (very similar to the 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(),但整个图形围绕刚才添加填充。

I tried using graph.getGridLabelRenderer().setPadding(), but that just added padding around the whole graph.

那么,有没有把一些填充围绕这些标签的方式?

So, is there a way to put some padding around those labels?

推荐答案

是有可能在目前的版本中github上(将在4.0.1发布)。
还有就是方法:

yes it is possible in the current version in github (will be released in 4.0.1). There is the method:

graph.getGridLabelRenderer().setLabelsSpace(x)

这篇关于在GraphView图和刻度标记之间添加空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆