Example usage for org.jfree.chart.renderer.xy StandardXYItemRenderer setAutoPopulateSeriesPaint

List of usage examples for org.jfree.chart.renderer.xy StandardXYItemRenderer setAutoPopulateSeriesPaint

Introduction

In this page you can find the example usage for org.jfree.chart.renderer.xy StandardXYItemRenderer setAutoPopulateSeriesPaint.

Prototype

public void setAutoPopulateSeriesPaint(boolean auto) 

Source Link

Document

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

Usage

From source file:org.spantus.exp.segment.draw.AbstractGraphGenerator.java

public JFreeChart getChart(ComparisionResult result) {
    CombinedDomainXYPlot plot = new CombinedDomainXYPlot(new NumberAxis("Time"));
    plot.setGap(10.0);/* w w w.ja  va2 s .  c  o m*/
    plot.setOrientation(PlotOrientation.VERTICAL);

    XYSeriesCollection[] seriesArr = createSeries(result);
    for (XYSeriesCollection series : seriesArr) {
        XYSeriesCollection data = series;
        StandardXYItemRenderer renderer = new StandardXYItemRenderer();
        renderer.setAutoPopulateSeriesPaint(false);
        renderer.setBasePaint(Color.BLACK);
        NumberAxis rangeAxis = new NumberAxis();
        rangeAxis.setLabel(((XYSeries) series.getSeries().get(0)).getDescription());
        rangeAxis.setAutoRange(true);
        XYPlot subplot = new XYPlot(data, null, rangeAxis, renderer);
        plot.add(subplot);
    }
    String name = result.getName() == null ? "Segmentation" : "Segmentation: " + result.getName();

    JFreeChart chart = new JFreeChart(name, JFreeChart.DEFAULT_TITLE_FONT, plot, true);

    return chart;

}