Prabs
Prabs

Reputation: 5173

MPAndroidChart - CombinedChart - First and last bars aren't visible completely

In CombinedChart by adding chart.setFitBars(true) will make the first and last bars visible.

I need to do the same for combining LineChart with BarChart.
Now, first and last bars aren't visible completely.

enter image description here

I've tried

xAxis.setAxisMaximum(data.getXMax() + 1f);

to extend X-Axis towards right side so that the last bar will get enough space. This did the trick.

But what should I do for left side bar?
setAxisMinimum doesn't help.

After adding setAxisMaximum :

enter image description here

EDIT

I've referred this but it gives the solution for only BarChart.

Upvotes: 3

Views: 1854

Answers (1)

Prabs
Prabs

Reputation: 5173

Got it.

xAxis.setAxisMinimum(-0.5f);

enter image description here

I guess, Edited X-Axis label will make it look good.

For editing labels in MPAndroidchart refer this answer

Upvotes: 7

Related Questions