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

谁说我不能喝 提交于 2019-12-13 23:46:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!