Example usage for org.jfree.chart.renderer.category BarRenderer setAutoPopulateSeriesFillPaint

List of usage examples for org.jfree.chart.renderer.category BarRenderer setAutoPopulateSeriesFillPaint

Introduction

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

Prototype

public void setAutoPopulateSeriesFillPaint(boolean auto) 

Source Link

Document

Sets the flag that controls whether or not the series fill paint list is automatically populated when #lookupSeriesFillPaint(int) is called.

Usage

From source file:de.fub.maps.project.detector.model.inference.ui.charts.AttributeSelectionBarChart.java

/**
 * Creates new form AttributeSelectionBarChart
 */// w  w w . jav  a  2 s .c o m
public AttributeSelectionBarChart() {
    initComponents();
    barChart = ChartFactory.createBarChart(
            NbBundle.getMessage(AttributeSelectionBarChart.class, "AttributeSelectionBarChart.CLT_Chart_Title"),
            NbBundle.getMessage(AttributeSelectionBarChart.class,
                    "AttributeSelectionBarChart.CLT_Domain_Axis_Name"),
            NbBundle.getMessage(AttributeSelectionBarChart.class,
                    "AttributeSelectionBarChart.CLT_Value_Axis_Name"),
            dataset, PlotOrientation.VERTICAL, true, true, true);
    plot = barChart.getCategoryPlot();
    Font font = new JLabel().getFont().deriveFont(Font.BOLD, 14);

    barChart.getTitle().setFont(font);
    barChart.getTitle().setPaint(new Color(153, 153, 153));

    plot.setRangeAxisLocation(0, AxisLocation.TOP_OR_LEFT);

    plot.setBackgroundPaint(Color.white);
    plot.getRangeAxis().setAutoRange(true);
    plot.getRangeAxis().setUpperMargin(.1);

    BarRenderer barRenderer = new BarRenderer();
    barRenderer.setBarPainter(new StandardBarPainter());
    barRenderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
    barRenderer.setBaseFillPaint(Color.BLUE);
    barRenderer.setBasePaint(Color.BLUE);
    barRenderer.setAutoPopulateSeriesFillPaint(false);
    barRenderer.setAutoPopulateSeriesPaint(false);
    barRenderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator(
            StandardCategoryItemLabelGenerator.DEFAULT_LABEL_FORMAT_STRING, new CustomNumberFormat()));
    barRenderer.setBaseItemLabelsVisible(true);

    plot.setRenderer(barRenderer);
    chartPanel = new ChartPanel(barChart, false);
    chartPanel.setVerticalAxisTrace(false);
    add(chartPanel, BorderLayout.CENTER);
}

From source file:de.fub.maps.project.plugins.tasks.eval.OverviewChart.java

/**
 * Creates new form OverviewChart/*from w ww . j  a  va2  s  .c o m*/
 */
public OverviewChart() {
    initComponents();
    barchart1.getRangeAxis()
            .setLabel(NbBundle.getMessage(OverviewChart.class, "overview.chart1.rangeaxis1.name"));
    barchart1.getPlot().setRangeAxis(1,
            new NumberAxis(NbBundle.getMessage(OverviewChart.class, "overview.chart1.rangeaxis2.name")));
    barchart1.getPlot().getRangeAxis(1).setUpperMargin(.1);
    barchart1.getPlot().getRangeAxis(0).setUpperMargin(.1);
    barchart1.getPlot().getRenderer(0).setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator(
            StandardCategoryItemLabelGenerator.DEFAULT_LABEL_FORMAT_STRING, new CustomNumberFormat()));
    barchart1.getPlot().getRenderer(0).setBaseItemLabelsVisible(true);
    BarRenderer barRenderer = new BarRenderer();
    barRenderer.setBarPainter(new StandardBarPainter());
    barRenderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
    barRenderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator(
            StandardCategoryItemLabelGenerator.DEFAULT_LABEL_FORMAT_STRING, new CustomNumberFormat()));
    barRenderer.setBaseItemLabelsVisible(true);
    barRenderer.setAutoPopulateSeriesFillPaint(true);
    barRenderer.setAutoPopulateSeriesPaint(true);
    barRenderer.setShadowVisible(false);
    barchart1.getPlot().setRenderer(1, barRenderer);
    CategoryPlot plot = barchart1.getPlot();
    plot.setDataset(1, new DefaultCategoryDataset());
    plot.mapDatasetToRangeAxis(0, 0);
    plot.mapDatasetToRangeAxis(1, 1);
}