Example usage for org.jfree.chart.renderer.xy XYItemRenderer drawRangeMarker

List of usage examples for org.jfree.chart.renderer.xy XYItemRenderer drawRangeMarker

Introduction

In this page you can find the example usage for org.jfree.chart.renderer.xy XYItemRenderer drawRangeMarker.

Prototype

public void drawRangeMarker(Graphics2D g2, XYPlot plot, ValueAxis axis, Marker marker, Rectangle2D dataArea);

Source Link

Document

Draws a horizontal line across the chart to represent a 'range marker'.

Usage

From source file:ucar.unidata.idv.control.chart.MyXYPlot.java

/**
 * Draws the range markers (if any) for a renderer and layer.  This method
 * is typically called from within the draw() method.
 *
 * @param g2  the graphics device./*w w  w . j a  va2s  .  c o  m*/
 * @param dataArea  the data area.
 * @param index  the renderer index.
 * @param layer  the layer (foreground or background).
 */
protected void drawRangeMarkers(Graphics2D g2, Rectangle2D dataArea, int index, Layer layer) {

    XYItemRenderer r = getRenderer(index);
    if (r == null) {
        return;
    }

    Collection markers = getRangeMarkers(index, layer);
    ValueAxis axis = getRangeAxis(index);
    // TODO: get the axis that the renderer maps to
    if ((markers != null) && (axis != null)) {
        Iterator iterator = markers.iterator();
        while (iterator.hasNext()) {
            Marker marker = (Marker) iterator.next();
            r.drawRangeMarker(g2, this, axis, marker, dataArea);
        }
    }

}