简体   繁体   中英

onChartFling never called in MPAndroidChart

I have problem that onChartFling method is never called in my LineChart or BarChart. All other methods from OnChartGestureListener are called correctly, but these not. I put a breakpoint alo int BarLineChartTouchListener. Not called also.

Or is they any other way how to detect end of scrollin on fling ? onChartTranslate is called multiple times, is it possible to find out if onChartTranslate was called when fling stopped ?

The author says, the way to solve this is to modify the library:

"The reason therefore is, that I do not want to permanently recognize a fling-gesture or single tap when the chart is zoomed in and panned / dragged. Therefore, gestures do not work in zoomed mode. If you want to disable this, you will have to modify the library."

These lines should be modified:

if(mTouchMode == NONE) { // remove the if
    mGestureDetector.onTouchEvent(event);
}

Code for changing is here: https://github.com/PhilJay/MPAndroidChart/issues/405

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM