首页 > 解决方案 > 滚动时图形数据与轴标签重叠

问题描述

启用滚动和/或缩放时,图表上的数据与图表的 y 轴重叠。y 轴标签可以被覆盖,数据也可以溢出右侧。有没有办法解决这个问题?

代码:

// min and max are the first and last X-values of the data
graph.getViewport().setXAxisBoundsManual(true);
graph.getViewport().setMinX(min);
graph.getViewport().setMaxX(max);
graph.getViewport().setScalable(true);
graph.getGridLabelRenderer().setNumHorizontalLabels(3); 
graph.getGridLabelRenderer().setHumanRounding(false);

在此处输入图像描述

编辑:在 Y 轴上启用缩放时也会发生这种现象,只是它与 X 轴重叠。

标签: android-graphview

解决方案


推荐阅读