0
votes

I'm using the latest version of the library and I can't get the HorizontalBarChart to draw the value above the bar, even after setting mChart.setDrawValueAboveBar(true) and invalidating the chart. Is this a bug or Is there a way to make this work?

Layout

<com.github.mikephil.charting.charts.HorizontalBarChart
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/expectativa_mensal_FEM"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

</com.github.mikephil.charting.charts.HorizontalBarChart>

Code

mHorizontalChart.setDrawValueAboveBar(true);
mHorizontalChart.invalidate();
1

1 Answers

1
votes

setDrawValueAboveBar() only sets the location of where you want to draw the values. Try using the method setDrawValues on your dataset and giving it a boolean value of true - I believe this will make your values appear.

dataset.setDrawValues(true)