MPAndroidChart - CombinedChart - the first and last bars are not displayed completely

In CombinedChart adding chart.setFitBars(true) , the first and last columns are displayed.

I need to do the same to combine LineChart with BarChart.
Now the first and last bars are not displayed completely.

enter image description here

I tried

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

to stretch the X-Axis towards the right side so that the last bar gets enough space. It did the trick.

But what should I do for the left sidebar?
setAxisMinimum does not help.

After adding setAxisMaximum :

enter image description here

EDIT

I named this one , but it gives a solution only for BarChart .

-one
mpandroidchart
source share
1 answer

Got it.

xAxis.setAxisMinimum(-0.5f);

enter image description here

I assume that the edited X-Axis shortcut will make it good.

To edit tags in MPAndroidchart refer to this answer

+2
source share

All Articles