List of usage examples for org.jfree.chart.plot XYPlot getDrawingSupplier
public DrawingSupplier getDrawingSupplier()
From source file:audio.cords.old.RegressionDemo.java
private static JFreeChart createChart(XYSeriesCollection data) { JFreeChart chart = ChartFactory.createScatterPlot(null, "X", "Y", data, PlotOrientation.VERTICAL, true, false, false);/*from ww w. j ava 2s.co m*/ XYPlot plot = (XYPlot) chart.getPlot(); XYItemRenderer scatterRenderer = plot.getRenderer(); StandardXYItemRenderer regressionRenderer = new StandardXYItemRenderer(); regressionRenderer.setBaseSeriesVisibleInLegend(false); plot.setDataset(1, regress(data)); plot.setRenderer(1, regressionRenderer); DrawingSupplier ds = plot.getDrawingSupplier(); for (int i = 0; i < data.getSeriesCount(); i++) { Paint paint = ds.getNextPaint(); scatterRenderer.setSeriesPaint(i, paint); regressionRenderer.setSeriesPaint(i, paint); } return chart; }
From source file:audio.cords.SimplestChart.java
private static JFreeChart createChart(XYSeriesCollection data) { JFreeChart chart = ChartFactory.createScatterPlot(null, "X", "Y", data, PlotOrientation.VERTICAL, true, false, false);//from w w w.j a v a 2 s .c o m XYPlot plot = (XYPlot) chart.getPlot(); XYItemRenderer scatterRenderer = plot.getRenderer(); // plot.getDomainAxis().resizeRange(2); // plot.getRangeAxis().resizeRange(2); plot.zoom(2); //StandardXYItemRenderer regressionRenderer = new StandardXYItemRenderer(); //regressionRenderer.setBaseSeriesVisibleInLegend(false); //plot.setDataset(1, regress(data)); //plot.setRenderer(1, regressionRenderer); DrawingSupplier ds = plot.getDrawingSupplier(); for (int i = 0; i < data.getSeriesCount(); i++) { Paint paint = ds.getNextPaint(); scatterRenderer.setSeriesPaint(i, paint); //regressionRenderer.setSeriesPaint(i, paint); } return chart; }
From source file:dr.PlotRenderer.java
public PlotRenderer(XYPlot plot, PCADataset dataset) { super(false, true); this.setSeriesShape(0, dataPointsShape); paintsForGroups = new Paint[dataset.getItemCount(1)]; DrawingSupplier drawSupp = plot.getDrawingSupplier(); for (int groupNumber = 0; groupNumber < dataset.getItemCount(1); groupNumber++) { Paint nextPaint = drawSupp.getNextPaint(); while (isAvoidColor((Color) nextPaint)) { nextPaint = drawSupp.getNextPaint(); }//from ww w.jav a2 s .c o m paintsForGroups[groupNumber] = nextPaint; } }
From source file:net.sf.mzmine.modules.peaklistmethods.dataanalysis.projectionplots.ProjectionPlotRenderer.java
public ProjectionPlotRenderer(XYPlot plot, ProjectionPlotDataset dataset) { super(false, true); this.dataset = dataset; this.setSeriesShape(0, dataPointsShape); paintsForGroups = new Paint[dataset.getNumberOfGroups()]; DrawingSupplier drawSupp = plot.getDrawingSupplier(); for (int groupNumber = 0; groupNumber < dataset.getNumberOfGroups(); groupNumber++) { Paint nextPaint = drawSupp.getNextPaint(); while (isAvoidColor((Color) nextPaint)) nextPaint = drawSupp.getNextPaint(); paintsForGroups[groupNumber] = nextPaint; }/*w w w . j av a 2 s .c om*/ }
From source file:guineu.modules.dataanalysis.PCA.ProjectionPlotRenderer.java
public ProjectionPlotRenderer(XYPlot plot, ProjectionPlotDataset dataset) { super(false, true); this.dataset = dataset; this.setSeriesShape(0, dataPointsShape); paintsForGroups = new Paint[dataset.getNumberOfGroups()]; DrawingSupplier drawSupp = plot.getDrawingSupplier(); for (int groupNumber = 0; groupNumber < dataset.getNumberOfGroups(); groupNumber++) { Paint nextPaint = drawSupp.getNextPaint(); while (isAvoidColor((Color) nextPaint)) { nextPaint = drawSupp.getNextPaint(); }//ww w . ja v a2 s . c o m paintsForGroups[groupNumber] = nextPaint; } }