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

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

Introduction

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

Prototype

public void setBaseNegativeItemLabelPosition(ItemLabelPosition position) 

Source Link

Document

Sets the base item label position for negative values and sends a RendererChangeEvent to all registered listeners.

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  a  2  s  . c om*/

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

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