-
Notifications
You must be signed in to change notification settings - Fork 812
Tap listener on data
Jonas Gehring edited this page Apr 12, 2019
·
2 revisions
It is possible to add a tap listener, that will be called if the user taps on a single data point. You have to add the listener to the series object. So if you have multiple series, you can use specific tap handler for any series.
Here is an example:
series.setOnDataPointTapListener(new OnDataPointTapListener() {
@Override
public void onTap(Series series, DataPointInterface dataPoint) {
Toast.makeText(getActivity(), "Series1: On Data Point clicked: "+dataPoint, Toast.LENGTH_SHORT).show();
}
});
Notice:
- If there is overlapping data because of multiple series, multiple listeners can be called due a single tap.
- The tap listener works also for bar charts