Example usage for org.jfree.chart.axis DateTick getRotationAnchor

List of usage examples for org.jfree.chart.axis DateTick getRotationAnchor

Introduction

In this page you can find the example usage for org.jfree.chart.axis DateTick getRotationAnchor.

Prototype

public TextAnchor getRotationAnchor() 

Source Link

Document

Returns the text anchor that defines the point around which the label is rotated.

Usage

From source file:org.codehaus.mojo.dashboard.report.plugin.chart.time.DashDateAxis.java

/**
 * @see org.jfree.chart.axis.DateAxis#refreshTicksHorizontal(java.awt.Graphics2D, java.awt.geom.Rectangle2D,
 *      org.jfree.ui.RectangleEdge)//from w  ww  . j av a  2  s .co m
 */

protected List refreshTicksHorizontal(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge) {

    if (getDateTickLabelAngle() == 0.0) {
        return super.refreshTicksHorizontal(g2, dataArea, edge);
    } else {
        setVerticalTickLabels(true);
        List ticks = super.refreshTicksHorizontal(g2, dataArea, edge);
        List ret = new ArrayList();

        for (int i = 0; i < ticks.size(); i++) {
            Object tick = ticks.get(i);
            if (tick instanceof DateTick) {
                DateTick dateTick = (DateTick) tick;
                ret.add(new DateTick(dateTick.getDate(), dateTick.getText(), dateTick.getTextAnchor(),
                        dateTick.getRotationAnchor(), getDateTickLabelAngle()));
            } else {
                ret.add(tick);
            }
        }
        return ret;
    }
}