Technote (troubleshooting)
Problem(Abstract)
Why the nearest data point is not selected when clicking on a polyline chart with IlvChartPickInteractor in the nearest point picking mode?
Cause
By default the pick distance is set to 5. As the API documentation states for IlvChartDataPicker.getPickDistance():
"This distance specifies the maximum distance from the picking point beyond which data points are not considered."
Therefore, if you are using the nearest point picking mode, your mouse click must be no more than 5 pixels away from a point for the nearest point to be found.
Resolving the problem
You can set a new pick distance by subclassing IlvChartPickInteractor and overriding its createDataPicker method. Inside the createDataPicker method you will return a new DataPicker in which you pass in the pick distance as the third argument.
Here is a code snippet that sets the pick distance to 300 pixels:
public class NearestInteractor extends IlvChartPickInteractor {
private int _minDist = 300;
public void setMinDist(int minDist) {
_minDist = minDist;
}
public int getMinDist() {
return _minDist;
}
protected IlvChartDataPicker createDataPicker(MouseEvent event)
{
return new DataPicker(event.getX(), event.getY(), _minDist);
}
}
| Segment | Product | Component | Platform | Version | Edition |
|---|---|---|---|---|---|
| Business Integration | IBM ILOG JViews Enterprise | SDK | Linux, Windows, Solaris, Mac OS X | 8.8, 8.7, 8.6 | All Editions |
Rate this page:
Copyright and trademark information
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.