问题
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.
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
:
EDIT
I've referred this but it gives the solution for only BarChart
.
回答1:
Got it.
xAxis.setAxisMinimum(-0.5f);
I guess, Edited X-Axis label will make it look good.
For editing labels in MPAndroidchart
refer this answer
来源:https://stackoverflow.com/questions/42064664/mpandroidchart-combinedchart-first-and-last-bars-arent-visible-completely