1
我正在使用GraphView库在我的android应用程序上创建图形,并且我的水平(X)轴标签出现问题。 正如你所看到的here轴上的数字标签有问题,数字互相盘旋,我愿意使用填充来避免这种情况。GraphView横轴标签填充
虽然经过长时间的在线调查,我还没有找到答案。
这里是我的图设计代码:
GraphView graph = (GraphView) findViewById(R.id.graph);
LineGraphSeries<DataPoint> series = new LineGraphSeries<>(getDataPoint());
GridLabelRenderer gridLabel = graph.getGridLabelRenderer();
gridLabel.setHumanRounding(true);
gridLabel.setNumHorizontalLabels(this.numberAxis);
gridLabel.setHorizontalAxisTitle(getApplicationContext().getString(R.string.updates));
gridLabel.setLabelHorizontalHeight(50);
gridLabel.setVerticalAxisTitle(getApplicationContext().getString(R.string.weight));
graph.addSeries(series);
我怎样才能避免相互横轴标签的徘徊?
没有足够的空间,所以您应该通过'setNumHorizontalLabels(5)'减少水平标签的数量 – appsthatmatter