Example usage for org.jfree.chart.axis Axis getLabelAngle

List of usage examples for org.jfree.chart.axis Axis getLabelAngle

Introduction

In this page you can find the example usage for org.jfree.chart.axis Axis getLabelAngle.

Prototype

public double getLabelAngle() 

Source Link

Document

Returns the angle of the axis label.

Usage

From source file:com.appnativa.rare.ui.chart.jfreechart.ChartHandler.java

protected void setLabelAngel(iPlatformComponent chartPanel, ChartDefinition cd, boolean range) {
    Axis a = getAxis(cd, range);
    int angle = range ? cd.getRangeAxis().getAngle() : cd.getDomainAxis().getAngle();

    if (a != null) {
        float ang = (float) Math.toRadians(angle);

        if (!SNumber.isEqual(ang, a.getLabelAngle())) {
            a.setLabelAngle(ang);/* w ww .jav a2  s  .com*/

            LabelData[] labels = null;

            if (a instanceof NumberAxisEx) {
                labels = ((NumberAxisEx) a).categoryLabels;
            } else if (a instanceof NumberAxis3DEx) {
                labels = ((NumberAxis3DEx) a).categoryLabels;
            }

            if (labels != null) {
                UIFont f = getAxisLabelFont(cd.getRangeAxis());

                remeasureLabels(labels, UIFontMetrics.getMetrics(f), angle);
            }
        }
    }
}