Вертикальная легенда неверное представление - PullRequest
0 голосов
/ 09 мая 2018

Я хочу, чтобы легенда отображалась вертикально справа от круговой диаграммы.В настоящее время я использую этот код:

legend.setVerticalAlignment(Legend.LegendVerticalAlignment.CENTER);
legend.setHorizontalAlignment(Legend.LegendHorizontalAlignment.RIGHT);
legend.setOrientation(Legend.LegendOrientation.VERTICAL);
legend.setDrawInside(false);

Код моего макета:

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@id/rl_supermarket_bar_chart"
    android:layout_marginBottom="10dp"
    android:layout_marginEnd="10dp"
    android:layout_marginStart="10dp"
    android:background="@drawable/layout_bg">

    <com.github.mikephil.charting.charts.PieChart
        android:id="@+id/pie_chart"
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:layout_centerHorizontal="true"/>

</RelativeLayout>

Но это делает диаграмму очень маленькой.Как я могу решить эту проблему?

enter image description here

...