答案 0 :(得分:1)
首先,您需要对数据集设置虚假绘制圆,如下所示:
lineDataSet.setDrawCircles(false);
之后,您需要按以下方式实现OnChartGestureListener():
lineChart.setOnChartGestureListener(new OnChartGestureListener()
{
@Override
public void onChartTranslate(MotionEvent me, float dX, float dY) {
// TODO Auto-generated method stub
}
@Override
public void onChartSingleTapped(MotionEvent me)
{
// TODO Auto-generated method stub
if(lineDataSet.isDrawCirclesEnabled())
{
lineDataSet.setDrawCircles(false);
}
else
{
lineDataSet.setDrawCircles(true);
}
}
@Override
public void onChartScale(MotionEvent me, float scaleX, float scaleY) {
// TODO Auto-generated method stub
}
@Override
public void onChartGestureStart(MotionEvent me, ChartTouchListener.ChartGesture lastPerformedGesture) {
}
@Override
public void onChartGestureEnd(MotionEvent me, ChartTouchListener.ChartGesture lastPerformedGesture) {
}
@Override
public void onChartLongPressed(MotionEvent me) {
// TODO Auto-generated method stub
}
@Override
public void onChartFling(MotionEvent me1, MotionEvent me2,
float velocityX, float velocityY) {
// TODO Auto-generated method stub
}
@Override
public void onChartDoubleTapped(MotionEvent me) {
// TODO Auto-generated method stub
}
});
这将完成工作。祝你好运兄弟!