Mpandroidchart: Labels for X axis cut off

Created on 11 Aug 2016  路  6Comments  路  Source: PhilJay/MPAndroidChart

Please see the screenshot
2016-08-11_15-49-02

Month names are cut off.
Library version is
compile 'com.github.PhilJay:MPAndroidChart:v2.2.5'

Let me know if you need more information.

Most helpful comment

I got it working by adding extra offsets:

            chart.setExtraOffsets(10, 10, 10, 10);

Works fine with v2 and v3 and a custom font.

2016-08-11_21-07-34

Thanks!

All 6 comments

does this still occur in v3?

Sorry, I didn't test yet. I tried to update the version of the library and there is so much changes.
Let me try to create a minimal project and then test using version 3.

Yep, the changes are huge :-D, let me know when you have tested it, thanks.

It seems that offset a slightly bigger for custom fonts. I use
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
and OpenSans fonts

Here is a default font (actually the 'y' in 'May' is very close to the bottom):
2016-08-11_20-14-26

and here is a result of:

        Typeface light = TypefaceUtils.load(this.getAssets(), "fonts/OpenSans-Light.ttf");
        xAxis.setTypeface(light);

2016-08-11_20-14-56

Should I try the 3.0 beta version?

I got it working by adding extra offsets:

            chart.setExtraOffsets(10, 10, 10, 10);

Works fine with v2 and v3 and a custom font.

2016-08-11_21-07-34

Thanks!

Okay, that's sort of a workaround. This still should not happen even with custom fonts, thanks for the report!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

botondbutuza picture botondbutuza  路  3Comments

Giammaofwar picture Giammaofwar  路  3Comments

galex picture galex  路  3Comments

Nima9Faraji picture Nima9Faraji  路  3Comments

SutharRohit picture SutharRohit  路  3Comments