MPAndroidChart隐藏背景网格 [英] MPAndroidChart hide background grid

查看:1014
本文介绍了MPAndroidChart隐藏背景网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Android应用程序中使用 MPAndroidChart -LineChart.我想从背景中删除网格线.如何从背景中删除网格线?

I'm using MPAndroidChart - LineChart in my android application. I want to remove gridlines from the background . How can I remove gridlines from the background?

库: GitHub上的MPAndroidChart

编辑:我使用此库创建了自己的自定义LineChart.我要删除底线.我也该怎么做?

I created my own custom LineChart using this library. I want to remove bottom line. how can I do that too?

推荐答案

使用此:

mChart.getAxisLeft().setDrawGridLines(false);
mChart.getXAxis().setDrawGridLines(false);

请注意,您可能需要右轴或两个都需要.这取决于您实际使用的轴.

Please note you may need right axis or both of them. It depends on axis you are actually using.

更新: 是轴线吗?如果是,则只需chart.getXAxis().setEnabled(false)

UPDATE: Is it axis line? If it is, then simply chart.getXAxis().setEnabled(false)

也可以:chart.getAxisLeft().setDrawAxisLine(false)

这篇关于MPAndroidChart隐藏背景网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆