Mpandroidchart: PieChart: extra padding at top

Created on 7 Oct 2014  路  9Comments  路  Source: PhilJay/MPAndroidChart

Hi @PhilJay,

just wanna to say you many thanks for your great library.

I'm playing with PieChart and I found some extra padding above it when using Legend.
Could you please help me to figure out how to fix it?
screenshot_2014-10-07-20-53-14

bug

Most helpful comment

@LeoYe168, give a try via Chart.setExtraBottomOffset(n); //n > default 15

All 9 comments

Also the same extra padding appears when I'm trying to align Legend with BOTTOM_CENTER. Another bad news is that Legend starting to overlap PieChart, please take a look at screenshot below
screenshot_2014-10-07-20-42-47

My code is so simple as bundled samples, here it is:

<com.github.mikephil.charting.charts.PieChart
        android:id="@+id/chart"
        android:layout_width="match_parent"
        android:layout_centerInParent="true"
        android:layout_height="345dp" />
mChart = (PieChart) findViewById(R.id.chart);
mChart.setDrawLegend(true);

setData(3, 100); // the same as in examples

mChart.animateXY(1500, 1500);

Legend l = mChart.getLegend();
l.setPosition(LegendPosition.RIGHT_OF_CHART);

Is there any way just to remove this extra padding at top?

Thank you in advance!

Seems like an issue in the calculateOffsets() method of the PieChart. I'm looking into it.

Regards,
Phil

Thank you for taking time!

Please try out the latest .jar file, the problem should be fixed now.

Hi @PhilJay,

sorry for delay and big thanks for hot fix from your side!
Now it works fine for me!

@PhilJay i want to set some extra padding in barchart bottom..which method ?

@LeoYe168, give a try via Chart.setExtraBottomOffset(n); //n > default 15

@coolscott 3ks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

galex picture galex  路  3Comments

andreyfel picture andreyfel  路  3Comments

JungYongWook picture JungYongWook  路  3Comments

Giammaofwar picture Giammaofwar  路  3Comments

rohitkumarbhagat picture rohitkumarbhagat  路  3Comments