Mpandroidchart: [BarChart] bars floating above the X-axis

Created on 17 Jul 2017  路  6Comments  路  Source: PhilJay/MPAndroidChart

Hi, I want to show datas in BarChart. And bars supposed to stand right above the X-axis line without spacing. But there is a gap between bar-bottom and the X-axis line.

Most helpful comment

Did you try this?

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

All 6 comments

I am experiencing the same issue. It seems the offset from the x axis is dependent on how many data points are supplied as part of the BarDataSets. In my app I'm using a CombinedChart and not a BarChart, so I cannot yet comment as to whether it happens generically to all charts containing BartSet(s). Here are a few examples:

screenshot_2017-08-13-16-13-25
screenshot_2017-08-13-16-13-32
screenshot_2017-08-13-16-14-05
screenshot_2017-08-13-16-14-09

If need be I can create a minimal sample that replicates the issue. If all contributes are busy I might take a crack at it after getting acquainted with the source and make a pull request.

Also, sorry about the screenshot size, I didn't realize the resolution was so large!

I'm having the same issue. Has anyone managed to resolve this?

It appears when you have huge difference between bar values like: 76, 81, 1, 2...etc. It's usual behavior.
No workaround so far...

Did you try this?

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

@elf-zwolf @alexander-jones
Yeah, I did it few days ago. Forget to mention here.
Right way to fix this problem!! Resolved.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AiTheAnswer picture AiTheAnswer  路  3Comments

OnlyInAmerica picture OnlyInAmerica  路  3Comments

botondbutuza picture botondbutuza  路  3Comments

ChenZeFengHi picture ChenZeFengHi  路  3Comments

AndroidJiang picture AndroidJiang  路  3Comments