Search in sources :

Example 1 with CategoryAnchor

use of org.jfree.chart.axis.CategoryAnchor in project SIMVA-SoS by SESoS.

the class CategoryPlot method drawDomainGridlines.

/**
 * Draws the domain gridlines for the plot, if they are visible.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 *
 * @see #drawRangeGridlines(Graphics2D, Rectangle2D, List)
 */
protected void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea) {
    if (!isDomainGridlinesVisible()) {
        return;
    }
    CategoryAnchor anchor = getDomainGridlinePosition();
    RectangleEdge domainAxisEdge = getDomainAxisEdge();
    CategoryDataset dataset = getDataset();
    if (dataset == null) {
        return;
    }
    CategoryAxis axis = getDomainAxis();
    if (axis != null) {
        int columnCount = dataset.getColumnCount();
        for (int c = 0; c < columnCount; c++) {
            double xx = axis.getCategoryJava2DCoordinate(anchor, c, columnCount, dataArea, domainAxisEdge);
            CategoryItemRenderer renderer1 = getRenderer();
            if (renderer1 != null) {
                renderer1.drawDomainGridline(g2, this, dataArea, xx);
            }
        }
    }
}
Also used : CategoryAnchor(org.jfree.chart.axis.CategoryAnchor) AbstractCategoryItemRenderer(org.jfree.chart.renderer.category.AbstractCategoryItemRenderer) CategoryItemRenderer(org.jfree.chart.renderer.category.CategoryItemRenderer) CategoryAxis(org.jfree.chart.axis.CategoryAxis) CategoryDataset(org.jfree.data.category.CategoryDataset) Paint(java.awt.Paint) RectangleEdge(org.jfree.ui.RectangleEdge)

Aggregations

Paint (java.awt.Paint)1 CategoryAnchor (org.jfree.chart.axis.CategoryAnchor)1 CategoryAxis (org.jfree.chart.axis.CategoryAxis)1 AbstractCategoryItemRenderer (org.jfree.chart.renderer.category.AbstractCategoryItemRenderer)1 CategoryItemRenderer (org.jfree.chart.renderer.category.CategoryItemRenderer)1 CategoryDataset (org.jfree.data.category.CategoryDataset)1 RectangleEdge (org.jfree.ui.RectangleEdge)1