I tried to change MPAndroid Chart text of "No Chart Data available" into "Loading Data..." while the data is retrieving.I had done this.But when there is no data the chart layout should shows ," NO DATA".
I am getting the Same Text(Loading Data...) eventhough there is no data.
protected void onDraw(Canvas canvas) {
if (!mDataNotSet && mData==null) {
canvas.drawText("NO DATA", getWidth() / 2, getHeight() / 3, mInfoPaint);
return;
}
if (mDataNotSet && mData == null || mData.getYValCount() <= 0) {
canvas.drawText"Laoding Data...",getWidth() / 2, getHeight() / 2, mInfoPaint);
if (!TextUtils.isEmpty(mNoDataTextDescription))
{
float textOffset = -mInfoPaint.ascent() + mInfoPaint.descent();
canvas.drawText(mNoDataTextDescription, getWidth()/2,(getHeight() / 2)
+ textOffset, mInfoPaint);
}
return;
}
if (!mOffsetsCalculated) {
calculateOffsets();
mOffsetsCalculated = true;
}
}