I don't want to show this,what am I to do?

Chart.java line 403
`
protected void onDraw(Canvas canvas) {
// super.onDraw(canvas);
if (mData == null) {
boolean hasText = !TextUtils.isEmpty(mNoDataText);
if (hasText) {
MPPointF c = getCenter();
canvas.drawText(mNoDataText, c.x, c.y, mInfoPaint);
}
return;
}
if (!mOffsetsCalculated) {
calculateOffsets();
mOffsetsCalculated = true;
}
}
`
@sharoncn thank you for you reply, through in the terms of .jar, rather than library, so I can not modify the chart file.
@sharoncn solved it.Just add this lineChart.setNoDataTextDescription(null);
@zhangxiaofan918 Thanks
@zhangxiaofan918 我遇到同样的问题 为什么我的去不掉
这个我也发现了,即便加了这行代码,偶尔也会出来的。
我的解决办法是加一个蒙层,没数据的时候显示这个View。
@android-home
@zhangxiaofan918 好吧。。。。
有2个方法,一个是setNoDataText(""),一个是setNoDataTextDescription(“”),没数据的时候你加第一个,就OK了
Most helpful comment
有2个方法,一个是setNoDataText(""),一个是setNoDataTextDescription(“”),没数据的时候你加第一个,就OK了