Example usage for org.jfree.chart.annotations XYPointerAnnotation getY

List of usage examples for org.jfree.chart.annotations XYPointerAnnotation getY

Introduction

In this page you can find the example usage for org.jfree.chart.annotations XYPointerAnnotation getY.

Prototype

public double getY() 

Source Link

Document

Returns the y coordinate for the text anchor point (measured against the range axis).

Usage

From source file:com.bwc.ora.views.LabelPopupMenu.java

private void removeAnnotation() {
    for (Object annotation : chartPanel.getChart().getXYPlot().getAnnotations()) {
        if (annotation instanceof XYPointerAnnotation) {
            XYPointerAnnotation pointer = (XYPointerAnnotation) annotation;
            if (pointer.getX() == item.getDataset().getXValue(item.getSeriesIndex(), item.getItem())
                    && pointer.getY() == item.getDataset().getYValue(item.getSeriesIndex(), item.getItem())) {
                chartPanel.getChart().getXYPlot().removeAnnotation(pointer);
                break;
            }/* w  ww .ja va2  s  . c  o m*/
        }
    }
}

From source file:com.bwc.ora.views.LabelPopupMenu.java

private boolean hasAnnoationAlready() {
    boolean hasAnnotationAlready = false;
    for (Object annotation : chartPanel.getChart().getXYPlot().getAnnotations()) {
        if (annotation instanceof XYPointerAnnotation) {
            XYPointerAnnotation pointer = (XYPointerAnnotation) annotation;
            if (pointer.getX() == item.getDataset().getXValue(item.getSeriesIndex(), item.getItem())
                    && pointer.getY() == item.getDataset().getYValue(item.getSeriesIndex(), item.getItem())) {
                hasAnnotationAlready = true;
                break;
            }/*from w ww .  ja v a2s . co  m*/
        }
    }
    return hasAnnotationAlready;
}