Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android graphview 在条形图中设置条形图的宽度_Android Graphview - Fatal编程技术网

Android graphview 在条形图中设置条形图的宽度

Android graphview 在条形图中设置条形图的宽度,android-graphview,Android Graphview,有没有办法控制条形图中条形的宽度?目前,我看到第一个和最后一个条形默认为剩余(中间)条形宽度的一半。注意,这是一个:无论如何,在v3.1.3和4.0.0之间似乎有很多变化,因为我也碰到了这个。库v3中的特定于条形图的逻辑将视口上下分流了半个xInterval,因此屏幕上第一个和最后一个条目的全宽条似乎已被删除,但编写代码很简单,例如 double xInterval=1.0; graphView.getViewport().setXAxisBoundsManual(true); if (data

有没有办法控制条形图中条形的宽度?目前,我看到第一个和最后一个条形默认为剩余(中间)条形宽度的一半。

注意,这是一个:无论如何,在v3.1.3和4.0.0之间似乎有很多变化,因为我也碰到了这个。库v3中的特定于条形图的逻辑将视口上下分流了半个xInterval,因此屏幕上第一个和最后一个条目的全宽条似乎已被删除,但编写代码很简单,例如

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());
}
这是下列文件的副本: