List of usage examples for org.jfree.chart.axis CategoryLabelPosition CategoryLabelPosition
public CategoryLabelPosition(RectangleAnchor categoryAnchor, TextBlockAnchor labelAnchor, CategoryLabelWidthType widthType, float widthRatio)
From source file:com.att.aro.ui.view.waterfalltab.WaterfallPanel.java
/** * @return the categoryAxis// ww w .j av a 2s .co m */ private CategoryAxis getCategoryAxis() { if (categoryAxis == null) { categoryAxis = new CategoryAxis(); categoryAxis.setMaximumCategoryLabelWidthRatio(0.2f); categoryAxis.setCategoryLabelPositions(CategoryLabelPositions.replaceLeftPosition( CategoryLabelPositions.STANDARD, new CategoryLabelPosition(RectangleAnchor.LEFT, TextBlockAnchor.CENTER_LEFT, CategoryLabelWidthType.RANGE, 1.0f))); } return categoryAxis; }
From source file:de.fhbingen.wbs.wpOverview.tabs.APCalendarPanel.java
/** * Create the JFreeChart./*from w w w . j a va 2 s . c om*/ * @param dataset * task list for the JFreeChart. * @return JFreeChart of tasks. */ private JFreeChart createChart(final IntervalCategoryDataset dataset) { final JFreeChart chart = ChartFactory.createGanttChart("", "", "", dataset, true, false, false); chart.getCategoryPlot().getDomainAxis().setCategoryMargin(0.4); chart.getCategoryPlot().getDomainAxis().setLowerMargin(0); chart.getCategoryPlot().getDomainAxis().setUpperMargin(0); chart.getCategoryPlot().getDomainAxis().setTickLabelFont(new Font(Font.SANS_SERIF, Font.PLAIN, 10)); chart.getCategoryPlot().getDomainAxis().setTickLabelInsets(new RectangleInsets(0, 0, 0, 0)); chart.getCategoryPlot().getDomainAxis() .setCategoryLabelPositions(new CategoryLabelPositions( new CategoryLabelPosition(RectangleAnchor.LEFT, TextBlockAnchor.CENTER_LEFT, CategoryLabelWidthType.RANGE, 1), new CategoryLabelPosition(RectangleAnchor.LEFT, TextBlockAnchor.CENTER_LEFT, CategoryLabelWidthType.RANGE, 1), new CategoryLabelPosition(RectangleAnchor.LEFT, TextBlockAnchor.CENTER_LEFT, CategoryLabelWidthType.RANGE, 1), new CategoryLabelPosition(RectangleAnchor.LEFT, TextBlockAnchor.CENTER_LEFT, CategoryLabelWidthType.RANGE, 1))); return chart; }