Example usage for org.jfree.chart.title LegendTitle setLegendItemGraphicAnchor

List of usage examples for org.jfree.chart.title LegendTitle setLegendItemGraphicAnchor

Introduction

In this page you can find the example usage for org.jfree.chart.title LegendTitle setLegendItemGraphicAnchor.

Prototype

public void setLegendItemGraphicAnchor(RectangleAnchor anchor) 

Source Link

Document

Sets the anchor point used for the graphic in each legend item.

Usage

From source file:com.xpn.xwiki.plugin.charts.ChartCustomizer.java

public static void customizeLegend(LegendTitle legend, ChartParams params) {
    if (params.get(ChartParams.LEGEND_BACKGROUND_COLOR) != null) {
        legend.setBackgroundPaint(params.getColor(ChartParams.LEGEND_BACKGROUND_COLOR));
    }/*from   w ww  .  j a  va 2  s. co m*/

    if (params.get(ChartParams.LEGEND_ITEM_FONT) != null) {
        legend.setItemFont(params.getFont(ChartParams.LEGEND_ITEM_FONT));
    }

    if (params.get(ChartParams.LEGEND_ITEM_LABEL_PADDING) != null) {
        legend.setItemLabelPadding(params.getRectangleInsets(ChartParams.LEGEND_ITEM_LABEL_PADDING));
    }

    if (params.get(ChartParams.LEGEND_ITEM_GRAPHIC_ANCHOR) != null) {
        legend.setLegendItemGraphicAnchor(params.getRectangleAnchor(ChartParams.LEGEND_ITEM_GRAPHIC_ANCHOR));
    }

    if (params.get(ChartParams.LEGEND_ITEM_GRAPHIC_EDGE) != null) {
        legend.setLegendItemGraphicEdge(params.getRectangleEdge(ChartParams.LEGEND_ITEM_GRAPHIC_EDGE));
    }

    if (params.get(ChartParams.LEGEND_ITEM_GRAPHIC_LOCATION) != null) {
        legend.setLegendItemGraphicAnchor(params.getRectangleAnchor(ChartParams.LEGEND_ITEM_GRAPHIC_LOCATION));
    }

    if (params.get(ChartParams.LEGEND_ITEM_GRAPHIC_PADDING) != null) {
        legend.setLegendItemGraphicPadding(params.getRectangleInsets(ChartParams.LEGEND_ITEM_GRAPHIC_PADDING));
    }
}