How to listen to the scroll finish event in mpandroidchart.
I overrided the OnChartGestureListener
and OnChartValueSelectedListener
but it does not seems to work. onChartTranslate()
method gets callback even after the scroll gets end.
onChartGestureStart()
gets called when the user touches the chart and onChartGestureEnd()
gets called once the user stops touching the chart.
So, i need to catch the event which gets called when the scroll gets finished.
So, Can you give a headsup on how to listen to the scroll end of linechart in mpandroidchart.
this worked for me checked both the start and end of scroll in chart
chart.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if(!(chart.getLowestVisibleX() == chart.getXAxis().getAxisMinimum() || chart.getHighestVisibleX() == chart.getXAxis().getAxisMaximum())){
// Do your work here
Toast.makeText(getContext(),"Hello Scroll to end check working",Toast.LENGTH_LONG).show();
return false;
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With