fun drawRangeLine( g2: java.awt.Graphics2D, plot: CategoryPlot, axis: ValueAxis, dataArea: java.awt.geom.Rectangle2D, value: Double, paint: Paint?, stroke: java.awt.Stroke? ) { val range: Range = axis.getRange() if (!range.contains(value)) { return } val adjusted: java.awt.geom.Rectangle2D = java.awt.geom.Rectangle2D.Double( dataArea.getX(), dataArea.getY() + getYOffset(), dataArea.getWidth() - getXOffset(), dataArea.getHeight() - getYOffset() ) var line1: java.awt.geom.Line2D? = null var line2: java.awt.geom.Line2D? = null val orientation: PlotOrientation = plot.getOrientation() if (orientation === PlotOrientation.HORIZONTAL) { val x0: Double = axis.valueToJava2D(value, adjusted, plot.getRangeAxisEdge()) val x1: Double = x0 + getXOffset() val y0: Double = dataArea.getMaxY() val y1: Double = y0 - getYOffset() val y2: Double = dataArea.getMinY() line1 = java.awt.geom.Line2D.Double(x0, y0, x1, y1) line2 = java.awt.geom.Line2D.Double(x1, y1, x1, y2) } else if (orientation === PlotOrientation.VERTICAL) { val y0: Double = axis.valueToJava2D(value, adjusted, plot.getRangeAxisEdge()) val y1: Double = y0 - getYOffset() val x0: Double = dataArea.getMinX() val x1: Double = x0 + getXOffset() val x2: Double = dataArea.getMaxX() line1 = java.awt.geom.Line2D.Double(x0, y0, x1, y1) line2 = java.awt.geom.Line2D.Double(x1, y1, x2, y1) } g2.setPaint(paint) g2.setStroke(stroke) g2.draw(line1) g2.draw(line2) }
Draws a line perpendicular to the range axis .