Android graphview 在条形图中设置条形图的宽度
有没有办法控制条形图中条形的宽度?目前,我看到第一个和最后一个条形默认为剩余(中间)条形宽度的一半。注意,这是一个:无论如何,在v3.1.3和4.0.0之间似乎有很多变化,因为我也碰到了这个。库v3中的特定于条形图的逻辑将视口上下分流了半个xInterval,因此屏幕上第一个和最后一个条目的全宽条似乎已被删除,但编写代码很简单,例如Android graphview 在条形图中设置条形图的宽度,android-graphview,Android Graphview,有没有办法控制条形图中条形的宽度?目前,我看到第一个和最后一个条形默认为剩余(中间)条形宽度的一半。注意,这是一个:无论如何,在v3.1.3和4.0.0之间似乎有很多变化,因为我也碰到了这个。库v3中的特定于条形图的逻辑将视口上下分流了半个xInterval,因此屏幕上第一个和最后一个条目的全宽条似乎已被删除,但编写代码很简单,例如 double xInterval=1.0; graphView.getViewport().setXAxisBoundsManual(true); if (data
double xInterval=1.0;
graphView.getViewport().setXAxisBoundsManual(true);
if (dataSeries instanceof BarGraphSeries ) {
// Shunt the viewport, per v3.1.3 to show the full width of the first and last bars.
graphView.getViewport().setMinX(dataSeries.getLowestValueX() - (xInterval/2.0));
graphView.getViewport().setMaxX(dataSeries.getHighestValueX() + (xInterval/2.0));
} else {
graphView.getViewport().setMinX(dataSeries.getLowestValueX() );
graphView.getViewport().setMaxX(dataSeries.getHighestValueX());
}
这是下列文件的副本: