Example usage for org.jfree.chart.renderer AbstractRenderer setBasePositiveItemLabelPosition

List of usage examples for org.jfree.chart.renderer AbstractRenderer setBasePositiveItemLabelPosition

Introduction

In this page you can find the example usage for org.jfree.chart.renderer AbstractRenderer setBasePositiveItemLabelPosition.

Prototype

public void setBasePositiveItemLabelPosition(ItemLabelPosition position) 

Source Link

Document

Sets the base positive item label position.

Usage

From source file:org.openfaces.component.chart.impl.configuration.GridLabelsConfigurator.java

private void defaultInit(GridChartView chartView, AbstractRenderer renderer) {
    final ChartLabelPosition positiveLabelsPosition = chartView.getPositiveLabelsPosition();
    final ChartLabelPosition negativeLabelsPosition = chartView.getNegativeLabelsPosition();
    final ChartLabelPosition defaultLabelPosition = chartView.getDefaultLabelsPosition();

    if (defaultLabelPosition != null && positiveLabelsPosition == null) {
        renderer.setBasePositiveItemLabelPosition(createItemLabelPosition(defaultLabelPosition));
    } else if (positiveLabelsPosition != null) {
        renderer.setBasePositiveItemLabelPosition(createItemLabelPosition(positiveLabelsPosition));
    }//w  w  w .  j  a v  a2 s .c o  m

    if (defaultLabelPosition != null && negativeLabelsPosition == null) {
        renderer.setBaseNegativeItemLabelPosition(createItemLabelPosition(defaultLabelPosition));
    } else if (negativeLabelsPosition != null) {
        renderer.setBaseNegativeItemLabelPosition(createItemLabelPosition(negativeLabelsPosition));
    }

    renderer.setItemLabelAnchorOffset(chartView.getLabelsOffset());
}