List of usage examples for org.jfree.chart.renderer.category GanttRenderer setBasePositiveItemLabelPosition
public void setBasePositiveItemLabelPosition(ItemLabelPosition position)
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; }