Example usage for org.jfree.chart.plot CategoryPlot getDomainGridlineStroke

List of usage examples for org.jfree.chart.plot CategoryPlot getDomainGridlineStroke

Introduction

In this page you can find the example usage for org.jfree.chart.plot CategoryPlot getDomainGridlineStroke.

Prototype

public Stroke getDomainGridlineStroke() 

Source Link

Document

Returns the stroke used to draw grid-lines against the domain axis.

Usage

From source file:edu.jhuapl.graphs.jfreechart.utils.SparselyLabeledCategoryAxis.java

private void drawDomainGridline(Graphics2D g2, CategoryPlot plot, Rectangle2D dataArea, double value) {
    Line2D line = null;//  w w w.  j  a  v  a2  s .co m
    PlotOrientation orientation = plot.getOrientation();

    if (orientation == PlotOrientation.HORIZONTAL) {
        line = new Line2D.Double(dataArea.getMinX(), value, dataArea.getMaxX(), value);
    } else if (orientation == PlotOrientation.VERTICAL) {
        line = new Line2D.Double(value, dataArea.getMinY(), value, dataArea.getMaxY());
    }

    g2.setPaint(domainGridlinePaint);
    Stroke stroke = plot.getDomainGridlineStroke();

    if (stroke == null) {
        stroke = CategoryPlot.DEFAULT_GRIDLINE_STROKE;
    }

    g2.setStroke(stroke);
    g2.draw(line);
}