Hello.
I'm trying to implement an update based on a Fling gesture, where new values are added to the graph as the user swipes left and right. However, onFling is not called back when a max visible X-range is set. This is my current setup:
mLineChart.setBackgroundColor(getResources().getColor(android.R.color.white));
mLineChart.setDragEnabled(true);
mLineChart.setTouchEnabled(true);
mLineChart.setOnChartGestureListener(mOnChartGestureListener);
mLineChart.setOnChartValueSelectedListener(mOnChartValueSelectedListener);
.........
.........
mLineChart.setData(lineData);
mLineChart.setVisibleXRange(7);
Is there another callback that we should use when performing a fling gesture with a Maximum visible X val set? Thanks.
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.
Look out for these lines
if(mTouchMode == NONE) { // remove the if
mGestureDetector.onTouchEvent(event);
}
in the BarLineChartTouchListener.java file and simply remove the "if" condition.
But why does the BarLineChartTouchListener.java file cannot be unlocked to make the modification suggested by the author?
@royseberg the suggestion was to basically clone the repository into your own project and just change those lines. Maybe this should be allowed in some manner without having to do that, though.
any chance to have an option to on/off the condition if(mTouchMode == NONE). It would be very useful
Most helpful comment
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.
Look out for these lines
in the
BarLineChartTouchListener.javafile and simply remove the "if" condition.