Example usage for org.jfree.chart.renderer.category GanttRenderer setBasePositiveItemLabelPosition

List of usage examples for org.jfree.chart.renderer.category GanttRenderer setBasePositiveItemLabelPosition

Introduction

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

Prototype

public void setBasePositiveItemLabelPosition(ItemLabelPosition position) 

Source Link

Document

Sets the base positive item label position.

Usage

From source file:org.jfree.chart.demo.GanttDemo3.java

private static JFreeChart createChart(IntervalCategoryDataset intervalcategorydataset) {
    JFreeChart jfreechart = ChartFactory.createGanttChart("Gantt Chart Demo", "Task", "Date",
            intervalcategorydataset, true, true, false);
    CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot();
    categoryplot.getDomainAxis().setMaximumCategoryLabelWidthRatio(10F);
    DateAxis dateaxis = (DateAxis) categoryplot.getRangeAxis();
    dateaxis.setUpperMargin(0.20000000000000001D);
    GanttRenderer ganttrenderer = (GanttRenderer) categoryplot.getRenderer();
    ganttrenderer.setDrawBarOutline(false);
    ganttrenderer.setBaseItemLabelGenerator(new MyLabelGenerator(new SimpleDateFormat("d-MMM")));
    ganttrenderer.setBaseItemLabelsVisible(true);
    ganttrenderer.setBasePositiveItemLabelPosition(
            new ItemLabelPosition(ItemLabelAnchor.OUTSIDE3, TextAnchor.CENTER_LEFT));
    return jfreechart;
}