MPAndroidChart-CombinedChart-首个和最后一个小节不完全可见 [英] MPAndroidChart - CombinedChart - First and last bars aren't visible completely
问题描述
通过添加chart.setFitBars(true)
将使第一个和最后一个小节可见.
In CombinedChart
by adding chart.setFitBars(true)
will make the first and last bars visible.
对于将LineChart与BarChart结合起来,我需要做同样的事情.
现在,第一个和最后一个小节不完全可见.
I need to do the same for combining LineChart with BarChart.
Now, first and last bars aren't visible completely.
我尝试过
xAxis.setAxisMaximum(data.getXMax() + 1f);
向右延伸X-Axis
,以便最后一个小节将获得足够的空间.这成功了.
to extend X-Axis
towards right side so that the last bar will get enough space. This did the trick.
但是我应该为左侧栏做什么?
setAxisMinimum
没有帮助.
But what should I do for left side bar?
setAxisMinimum
doesn't help.
添加setAxisMaximum
后:
After adding setAxisMaximum
:
编辑
我已经引用了BarChart
的解决方案.
I've referred this but it gives the solution for only BarChart
.
推荐答案
知道了.
xAxis.setAxisMinimum(-0.5f);
我想,编辑X轴"标签会使它看起来不错.
I guess, Edited X-Axis label will make it look good.
要在MPAndroidchart
中编辑标签,请参考此答案
For editing labels in MPAndroidchart
refer this answer
这篇关于MPAndroidChart-CombinedChart-首个和最后一个小节不完全可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!