I am facing with a werid problem. The demos run well, but in my own app, If I switched to another app, and then switched back, there would be an small duplicated chart on the left bottom.
The chart in my app will be updated(add new (x,y) and repaint) at intervals.
Attached are the original image and image after switched back.
I suspect there are some problems with my onResume() method.
@Override
protected void onResume() {
super.onResume();
if (mChartView == null) {
LinearLayout layout = (LinearLayout) findViewById(R.id.linearlayout_chart);
mChartView = ChartFactory.getLineChartView(this, mDataSet, mRenderer);
mRenderer.setClickEnabled(true);
mRenderer.setSelectableBuffer(100);
mChartView.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
}
});
mChartView.setOnLongClickListener(new OnLongClickListener() {
public boolean onLongClick(View v) {
return false;
}
});
mChartView.addZoomListener(new ZoomListener() {
public void zoomApplied(ZoomEvent e) {
}
public void zoomReset() {
}
}, true, true);
mChartView.addPanListener(new PanListener() {
public void panApplied() {}
});
layout.addView(mChartView, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
}
mChartView.repaint();
}
I cannot figure out why did this happen, does anyone have the same problem?
The normal chart:
After switched back from another app:
Android 3.2 (API Level 13) AChartEngine version 0.7.0 Asus EEE pad