Example usage for org.jfree.ui Align TOP_LEFT

List of usage examples for org.jfree.ui Align TOP_LEFT

Introduction

In this page you can find the example usage for org.jfree.ui Align TOP_LEFT.

Prototype

int TOP_LEFT

To view the source code for org.jfree.ui Align TOP_LEFT.

Click Source Link

Document

Top/Left alignment.

Usage

From source file:org.operamasks.faces.render.graph.ChartRenderer.java

private int getImageAlign(PositionType position) {
    if (position != null) {
        switch (position) {
        case Top:
            return Align.TOP;
        case Bottom:
            return Align.BOTTOM;
        case Left:
            return Align.LEFT;
        case Right:
            return Align.RIGHT;
        case TopLeft:
            return Align.TOP_LEFT;
        case LeftTop:
            return Align.TOP_LEFT;
        case TopRight:
            return Align.TOP_RIGHT;
        case RightTop:
            return Align.TOP_RIGHT;
        case BottomLeft:
            return Align.BOTTOM_LEFT;
        case LeftBottom:
            return Align.BOTTOM_LEFT;
        case BottomRight:
            return Align.BOTTOM_RIGHT;
        case RightBottom:
            return Align.BOTTOM_RIGHT;
        case Center:
            return Align.CENTER;
        case Stretch:
            return Align.FIT;
        }/*w  w w. j  a v a 2  s .  c  om*/
    }
    return Align.FIT;
}

From source file:org.ramadda.data.services.PointFormHandler.java

/**
 * create jfree chart//  w ww  .j  a v a 2 s .com
 *
 * @param request the request
 * @param entry The entry
 * @param dataset the dataset
 * @param backgroundImage background image
 *
 * @return the chart
 */
public static JFreeChart createTimeseriesChart(Request request, Entry entry, XYDataset dataset,
        Image backgroundImage) {
    JFreeChart chart = ChartFactory.createXYLineChart("", // chart title
            "", // x axis label
            "Height", // y axis label
            dataset, // data
            PlotOrientation.VERTICAL, true, // include legend
            true, // tooltips
            false // urls
    );

    DateAxis timeAxis = new DateAxis("Time", request.getRepository().TIMEZONE_UTC);
    NumberAxis valueAxis = new NumberAxis("Data");
    valueAxis.setAutoRangeIncludesZero(true);

    XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, null);

    chart = new JFreeChart("", JFreeChart.DEFAULT_TITLE_FONT, plot, true);

    chart.setBackgroundPaint(Color.white);
    if (backgroundImage != null) {
        plot.setBackgroundImage(backgroundImage);
        plot.setBackgroundImageAlignment(org.jfree.ui.Align.TOP_LEFT);
    }

    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);

    plot.setInsets(new RectangleInsets(0, 0, 0, 0));
    plot.setAxisOffset(new RectangleInsets(5, 0, 5, 0));

    return chart;
}