如何在MPAndroidChart中设置水平条的最大高度?

时间:2015-05-11 12:43:21

标签: android mpandroidchart

我正在使用MPAndroidChart库。在水平条形图中如何设置条形的最大高度?enter image description here以及如何设置背景 酒吧的颜色。

2 个答案:

答案 0 :(得分:2)

栏的高度本身由HorizontalBarChart中的项目数计算。没有办法直接改变它。

如果数量较少,可以使图表的整个高度变小。

答案 1 :(得分:1)

如何设置水平栏的最大高度:

val barData = BarData(barDataSet)
barData.barWidth = 1.30f
chartIncidentType.data = barData // wherein chartIncidentType is com.github.mikephil.charting.charts.HorizontalBarChart