Moderator: JIDE Support
chart.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
if (Chart.PROPERTY_CURRENT_CHART_POINT.equals(evt.getPropertyName())) {
Chartable p = chart.getCurrentChartPoint();
if (p == null) {
chart.setToolTipText(null);
} else {
String text = String.format("x = %.2f, y = %.2f", p.getX().position(),
p.getY().position());
chart.setToolTipText(text);
}
}
}
});
Users browsing this forum: No registered users and 12 guests