Skip to content

PieChart: extra padding at top #137

Description

@romangromov

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

Activity

  1. romangromov commented on Oct 7, 2014

    @romangromov
    ContributorAuthor

    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

  2. romangromov commented on Oct 7, 2014

    @romangromov
    ContributorAuthor

    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!

  3. PhilJay commented on Oct 7, 2014

    @PhilJay
    Owner

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

    Regards,
    Phil

  4. romangromov commented on Oct 8, 2014

    @romangromov
    ContributorAuthor

    Thank you for taking time!

  5. added
    bugconfirmed bugs or otherwise incorrect behavior
    on Oct 8, 2014
  6. PhilJay commented on Oct 8, 2014

    @PhilJay
    Owner

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

  7. romangromov commented on Oct 14, 2014

    @romangromov
    ContributorAuthor

    Hi @PhilJay,

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

  8. LeoYe168 commented on Dec 23, 2015

    @LeoYe168

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

  9. Jasper009-So commented on Dec 23, 2015

    @Jasper009-So

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

  10. liuzheng9110 commented on Sep 12, 2017

    @liuzheng9110

    @coolscott 3ks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugconfirmed bugs or otherwise incorrect behavior

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions