Example usage for org.jfree.chart.plot CategoryMarker getLabel

List of usage examples for org.jfree.chart.plot CategoryMarker getLabel

Introduction

In this page you can find the example usage for org.jfree.chart.plot CategoryMarker getLabel.

Prototype

public String getLabel() 

Source Link

Document

Returns the label (if null no label is displayed).

Usage

From source file:nl.strohalm.cyclos.controls.reports.statistics.graphs.ChartPostProcessorImpl.java

@SuppressWarnings("rawtypes")
private void setMarkers(final CategoryPlot plot, final Map params) {
    final Marker[] domainMarkers = (Marker[]) params.get("domainMarkers");
    // this method may be extended for range markers in future.
    if (domainMarkers != null && domainMarkers.length > 0) {
        for (final Marker marker : domainMarkers) {
            final CategoryMarker cmarker = (CategoryMarker) marker;
            cmarker.setDrawAsLine(true);
            if (cmarker.getLabel() != null) {
                cmarker.setLabelAnchor(RectangleAnchor.TOP_LEFT);
                cmarker.setLabelTextAnchor(TextAnchor.TOP_RIGHT);
            }// ww w. ja  v a  2  s  . c om
            plot.addDomainMarker(cmarker);
        }
    }
}