码迷,mamicode.com
首页 > 移动开发 > 详细

app hellocharts 柱状图

时间:2019-07-11 20:11:11      阅读:205      评论:0      收藏:0      [点我收藏+]

标签:image   code   values   array   eth   找不到   into   out   mic   

app里有个告警数量的柱状图,有点小问题,y轴竟然不是整数

技术图片

 这个改起来到是简单

Axis yAxis = new Axis().setHasLines(true).setTextColor(Color.BLACK);
yAxis.setMaxLabelChars(6);

maxValue = (maxValue / 10 + 1) * 10;
List<AxisValue> yValues = new ArrayList<AxisValue>();
for (int i = 0; i <= 10; i++) {
    yValues.add(new AxisValue(i));
}
yAxis.setValues(yValues); 

只是出来的结果有点不对劲,怎么这个柱形图“顶天立地了”,乍一看,还以为有一部分被挡住了

 技术图片

是不是有种戛然而止的感觉

不过这个我调试了半天,是真不晓得怎么搞,想看看源码也找不到源码,就改了下padding的值,变成下面的效果,将就着看吧

<lecho.lib.hellocharts.view.ColumnChartView
    android:id="@+id/chart"
    android:layout_width="match_parent"
    android:layout_height="250dp"
    android:layout_marginTop="10dp"
    android:paddingTop="10dp"
    android:background="#ffffff" />

 

技术图片

 

app hellocharts 柱状图

标签:image   code   values   array   eth   找不到   into   out   mic   

原文地址:https://www.cnblogs.com/LcxSummer/p/11171936.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!