How do I progammatically deselect a chart value in code? I would do it in onFling.
Maybe this
mChart.highlightValues(null);
Highlights the values at the given indices in the given DataSets. Provide null or an empty array to undo all highlighting. This should be used to programmatically highlight values. This DOES NOT generate a callback to the OnChartValueSelectedListener.
I know this post is old, but this is how I implemented this (in case anyone is wondering):
mChart.setOnChartValueSelectedListener(new OnChartValueSelectedListener() {
@Override
public void onValueSelected(Entry e, int dataSetIndex, Highlight h) {
final Handler handler = new Handler();
Runnable runnable = new Runnable() {
@Override
public void run() {
mChart.highlightValues(null);
}
};
//un-highlight after 2 seconds
handler.postDelayed(runnable, 2000);
}
@Override
public void onNothingSelected() {
}
});
Most helpful comment
Maybe this