I have a ListView that show charts (barchart MPAndroidChart) in it, my layout code is this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/linlayme">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Medium Text"
android:id="@+id/reportname"
android:layout_gravity="center_horizontal"
android:paddingTop="8dp"
android:paddingBottom="8dp" />
<com.github.mikephil.charting.charts.BarChart
android:id="@+id/chart"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
In run time it does not show any chart. When defining width and height like 200dp charts shows, how can I set the size of the bar chart to match the parent?
You have to set the height
(This layout is used in the example of MpAndroidListViewChart)