Mpandroidchart: Space between bar and xAxis labels.

Created on 30 May 2018  ·  15Comments  ·  Source: PhilJay/MPAndroidChart

Please help me xAxis labels and bar gap is increased if any of the bar value is 0.

Please look the below images.

When any bar value is 0;

device-2018-05-30-124154

When all bar value is more than 0;

device-2018-05-30-124318

I am sure you can notice the space in both situation, I want all labels to be assigned like in the second image irrespective of value.

Most helpful comment

@RobertZagorski Finally I resolved the issue using xAxis.setYOffset. Thanks for the help, I am closing this issue.

All 15 comments

Hi There,

I am still waiting for the response, 6 days are already gone.
Please reply back need to resolve this issue ASAP.

If you could verify, whether newest master version fixes the problem that would be great.
Your problem was probably fixed in PR https://github.com/PhilJay/MPAndroidChart/pull/4013

@RobertZagorski I am using the latest version of your library. The fix PR #4013 you shared is for label rotation, whereas I want to reduce the gap between the labels and the X-axis when any of the bar value is 0.

You are checking newest git master ref or newest version published to bintray repository?
Those are the different ones.

Hi,

Can u please share the link for the latest master library.

Get Outlook for Androidhttps://aka.ms/ghei36


From: RobertZagorski notifications@github.com
Sent: Thursday, June 7, 2018 12:32:37 AM
To: PhilJay/MPAndroidChart
Cc: pankaj210891; Author
Subject: Re: [PhilJay/MPAndroidChart] Space between bar and xAxis labels. (#4070)

You are checking newest git master ref or newest version published to bintray repository?
Those are the different ones.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/PhilJay/MPAndroidChart/issues/4070#issuecomment-395178437, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVGMAG8nBhq0TPVexoZpUnHP6LDpdy8-ks5t6CdNgaJpZM4USt-g.

You need to download the library from github, make it as a module in your project (remove gradle dependency to MPAndroidChart), compile, open and try to reproduce the crash.

Hi There,

I am already using the library as a module.

I noticed that when any bar value is 0 then there is a space between the labels and X-axis.

Get Outlook for Androidhttps://aka.ms/ghei36


From: RobertZagorski notifications@github.com
Sent: Friday, June 8, 2018 3:42:07 PM
To: PhilJay/MPAndroidChart
Cc: pankaj210891; Author
Subject: Re: [PhilJay/MPAndroidChart] Space between bar and xAxis labels. (#4070)

You need to download the library from github, make it as a module in your project (remove gradle dependency to MPAndroidChart), compile, open and try to reproduce the crash.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/PhilJay/MPAndroidChart/issues/4070#issuecomment-395716546, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVGMAO-vwvzSGEEZNpQbde5jgLIbuLMyks5t6k33gaJpZM4USt-g.

So indeed this is a bug in the library.
Thanks for cooperating :)

So what's now?

Get Outlook for Androidhttps://aka.ms/ghei36


From: RobertZagorski notifications@github.com
Sent: Friday, June 8, 2018 8:46:52 PM
To: PhilJay/MPAndroidChart
Cc: pankaj210891; Author
Subject: Re: [PhilJay/MPAndroidChart] Space between bar and xAxis labels. (#4070)

So indeed this is a bug in the library.
Thanks for cooperating :)


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/PhilJay/MPAndroidChart/issues/4070#issuecomment-395793300, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVGMAEJXTthGFpatBE4Jcn8CdplfDDMLks5t6pVkgaJpZM4USt-g.

@RobertZagorski Any solution? or any suggestion.

@RobertZagorski Any solution? or any suggestion.

@RobertZagorski Finally I resolved the issue using xAxis.setYOffset. Thanks for the help, I am closing this issue.

had a similar issue, was able to resolve with

chart.axisLeft.axisMinimum = 0f
chart.axisRight.axisMinimum = 0f

@AndroidGecko Thanks, but its a little bit changed like

 chart.getAxisLeft().setAxisMinimum(0);
 chart.getAxisRight().setAxisMinimum(0);

had a similar issue, was able to resolve with

chart.axisLeft.axisMinimum = 0f
chart.axisRight.axisMinimum = 0f

(Y)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andreyfel picture andreyfel  ·  3Comments

mrZizik picture mrZizik  ·  3Comments

AiTheAnswer picture AiTheAnswer  ·  3Comments

thanhcly920 picture thanhcly920  ·  3Comments

DarkHelmet67 picture DarkHelmet67  ·  3Comments