List of usage examples for org.jfree.chart.renderer.xy StandardXYItemRenderer setAutoPopulateSeriesPaint
public void setAutoPopulateSeriesPaint(boolean auto)
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; }