Example usage for org.jfree.chart.renderer.category BarRenderer3D setItemLabelFont

List of usage examples for org.jfree.chart.renderer.category BarRenderer3D setItemLabelFont

Introduction

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

Prototype

public void setItemLabelFont(Font font) 

Source Link

Document

Sets the item label font for ALL series and sends a RendererChangeEvent to all registered listeners.

Usage

From source file:org.bench4Q.console.ui.section.E_ErrorSection.java

private JPanel printErrorPic() throws IOException {
    CategoryDataset dataset = getDataSet();
    JFreeChart chart = ChartFactory.createBarChart3D("Error", "Error type", "Error number", dataset,
            PlotOrientation.VERTICAL, true, true, true);
    CategoryPlot plot = chart.getCategoryPlot();
    org.jfree.chart.axis.CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setLowerMargin(0.1);//from  w  ww.  j av  a 2 s . c o  m
    domainAxis.setUpperMargin(0.1);
    domainAxis.setCategoryLabelPositionOffset(10);
    domainAxis.setCategoryMargin(0.2);
    domainAxis.setCategoryLabelPositionOffset(10);

    org.jfree.chart.axis.ValueAxis rangeAxis = plot.getRangeAxis();
    rangeAxis.setUpperMargin(0.1);

    org.jfree.chart.renderer.category.BarRenderer3D renderer;
    renderer = new org.jfree.chart.renderer.category.BarRenderer3D();
    renderer.setBaseOutlinePaint(Color.red);
    renderer.setSeriesPaint(0, new Color(0, 255, 255));
    renderer.setSeriesOutlinePaint(0, Color.BLACK);
    renderer.setSeriesPaint(1, new Color(0, 255, 0));
    renderer.setSeriesOutlinePaint(1, Color.red);
    renderer.setItemMargin(0.1);
    renderer.setItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    renderer.setItemLabelFont(new Font("", Font.BOLD, 12));
    renderer.setItemLabelPaint(Color.black);
    renderer.setItemLabelsVisible(true);
    plot.setRenderer(renderer);

    plot.setDomainAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
    plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
    plot.setBackgroundPaint(Color.WHITE);

    return new ChartPanel(chart);
}

From source file:org.bench4Q.console.ui.section.S_LengthSection.java

/**
 * @return/*from  www .j a v a2  s . c  o  m*/
 * @throws IOException
 */
public JPanel drawSessionPic() throws IOException {

    CategoryDataset dataset = getDataSet();
    JFreeChart chart = ChartFactory.createBarChart3D("Session", "Session type", "Session number", dataset,
            PlotOrientation.VERTICAL, true, true, true);
    CategoryPlot plot = chart.getCategoryPlot();
    org.jfree.chart.axis.CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setLowerMargin(0.1);
    domainAxis.setUpperMargin(0.1);
    domainAxis.setCategoryLabelPositionOffset(10);
    domainAxis.setCategoryMargin(0.2);

    org.jfree.chart.axis.ValueAxis rangeAxis = plot.getRangeAxis();
    rangeAxis.setUpperMargin(0.1);

    org.jfree.chart.renderer.category.BarRenderer3D renderer;
    renderer = new org.jfree.chart.renderer.category.BarRenderer3D();
    renderer.setBaseOutlinePaint(Color.red);
    renderer.setSeriesPaint(0, new Color(0, 255, 255));
    renderer.setSeriesOutlinePaint(0, Color.BLACK);
    renderer.setSeriesPaint(1, new Color(0, 255, 0));
    renderer.setSeriesOutlinePaint(1, Color.red);
    renderer.setItemMargin(0.1);
    renderer.setItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    renderer.setItemLabelFont(new Font("", Font.BOLD, 12));
    renderer.setItemLabelPaint(Color.black);
    renderer.setItemLabelsVisible(true);
    plot.setRenderer(renderer);

    plot.setDomainAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
    plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
    plot.setBackgroundPaint(Color.WHITE);

    return new ChartPanel(chart);
}

From source file:org.bench4Q.console.ui.section.S_SummarizeSection.java

/**
 * @return/*  w  ww. j  a  v a  2s  . c om*/
 * @throws IOException
 */
public JPanel drawSessionPic() throws IOException {

    CategoryDataset dataset = getDataSet();
    JFreeChart chart = ChartFactory.createBarChart3D("Session", "Session type", "Session number", dataset,
            PlotOrientation.VERTICAL, true, true, true);
    CategoryPlot plot = chart.getCategoryPlot();
    org.jfree.chart.axis.CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setLowerMargin(0.1);
    domainAxis.setUpperMargin(0.1);
    domainAxis.setCategoryLabelPositionOffset(10);
    domainAxis.setCategoryMargin(0.2);

    org.jfree.chart.axis.ValueAxis rangeAxis = plot.getRangeAxis();
    rangeAxis.setUpperMargin(0.1);

    org.jfree.chart.renderer.category.BarRenderer3D renderer;
    renderer = new org.jfree.chart.renderer.category.BarRenderer3D();
    renderer.setBaseOutlinePaint(Color.red);
    renderer.setSeriesPaint(0, new Color(0, 255, 255));
    renderer.setSeriesOutlinePaint(0, Color.BLACK);
    renderer.setSeriesPaint(1, new Color(0, 255, 0));
    renderer.setSeriesOutlinePaint(1, Color.red);
    renderer.setItemMargin(0.1);

    renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    renderer.setItemLabelFont(new Font("", Font.PLAIN, 12));
    renderer.setItemLabelPaint(Color.black);
    renderer.setItemLabelsVisible(true);
    plot.setRenderer(renderer);

    plot.setDomainAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
    plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
    plot.setBackgroundPaint(Color.WHITE);

    return new ChartPanel(chart);
}