List of usage examples for org.jfree.chart.renderer.xy XYSplineRenderer setSeriesLinesVisible
public void setSeriesLinesVisible(int series, Boolean flag)
From source file:loci.slim2.process.interactive.ui.DefaultDecayGraph.java
/** * Creates the chart/* w w w. j a v a2 s.co m*/ * * @param bins number of bins * @param timeInc time increment per bin * @return the chart */ JFreeChart createCombinedChart(final int bins, final double timeInc) { // create empty chart data sets decayDataset = new XYSeriesCollection(); residualDataset = new XYSeriesCollection(); // make a common horizontal axis for both sub-plots final NumberAxis timeAxis = new NumberAxis(TIME_AXIS_LABEL); timeAxis.setLabel(UNITS_LABEL); timeAxis.setRange(0.0, (bins - 1) * timeInc); // make a vertically combined plot final CombinedDomainXYPlot parent = new CombinedDomainXYPlot(timeAxis); // create decay sub-plot NumberAxis photonAxis; if (logarithmic) { photonAxis = new LogarithmicAxis(PHOTON_AXIS_LABEL); } else { photonAxis = new NumberAxis(PHOTON_AXIS_LABEL); } final XYSplineRenderer decayRenderer = new XYSplineRenderer(); decayRenderer.setSeriesShapesVisible(0, false); decayRenderer.setSeriesShapesVisible(1, false); decayRenderer.setSeriesLinesVisible(2, false); decayRenderer.setSeriesShape(2, new Ellipse2D.Float(-1.0f, -1.0f, 2.0f, 2.0f)); decayRenderer.setSeriesPaint(0, PROMPT_COLOR); decayRenderer.setSeriesPaint(1, FITTED_COLOR); decayRenderer.setSeriesPaint(2, DECAY_COLOR); decaySubPlot = new XYPlot(decayDataset, null, photonAxis, decayRenderer); decaySubPlot.setDomainCrosshairVisible(true); decaySubPlot.setRangeCrosshairVisible(true); // add decay sub-plot to parent parent.add(decaySubPlot, DECAY_WEIGHT); // create residual sub-plot final NumberAxis residualAxis = new NumberAxis(RESIDUAL_AXIS_LABEL); final XYSplineRenderer residualRenderer = new XYSplineRenderer(); residualRenderer.setSeriesPaint(0, RESIDUAL_COLOR); residualRenderer.setSeriesLinesVisible(0, false); residualRenderer.setSeriesShape(0, new Ellipse2D.Float(-1.0f, -1.0f, 2.0f, 2.0f)); final XYPlot residualSubPlot = new XYPlot(residualDataset, null, residualAxis, residualRenderer); residualSubPlot.setDomainCrosshairVisible(true); residualSubPlot.setRangeCrosshairVisible(true); residualSubPlot.setFixedLegendItems(null); // add residual sub-plot to parent parent.add(residualSubPlot, RESIDUAL_WEIGHT); // now make the top level JFreeChart final JFreeChart chart = new JFreeChart(null, JFreeChart.DEFAULT_TITLE_FONT, parent, true); chart.removeLegend(); return chart; }
From source file:loci.slim.ui.DecayGraph.java
/** * Creates the chart/*from w w w.j av a 2s . co m*/ * * @param bins number of bins * @param timeInc time increment per bin * @return the chart */ JFreeChart createCombinedChart(final int bins, final double timeInc) { // create empty chart data sets _decayDataset = new XYSeriesCollection(); _residualDataset = new XYSeriesCollection(); // make a common horizontal axis for both sub-plots final NumberAxis timeAxis = new NumberAxis(TIME_AXIS_LABEL); timeAxis.setLabel(UNITS_LABEL); timeAxis.setRange(0.0, (bins - 1) * timeInc); // make a vertically combined plot final CombinedDomainXYPlot parent = new CombinedDomainXYPlot(timeAxis); // create decay sub-plot NumberAxis photonAxis; if (_logarithmic) { photonAxis = new LogarithmicAxis(PHOTON_AXIS_LABEL); } else { photonAxis = new NumberAxis(PHOTON_AXIS_LABEL); } final XYSplineRenderer decayRenderer = new XYSplineRenderer(); decayRenderer.setSeriesShapesVisible(0, false); decayRenderer.setSeriesShapesVisible(1, false); decayRenderer.setSeriesLinesVisible(2, false); decayRenderer.setSeriesShape(2, new Ellipse2D.Float(-1.0f, -1.0f, 2.0f, 2.0f)); decayRenderer.setSeriesPaint(0, PROMPT_COLOR); decayRenderer.setSeriesPaint(1, FITTED_COLOR); decayRenderer.setSeriesPaint(2, DECAY_COLOR); _decaySubPlot = new XYPlot(_decayDataset, null, photonAxis, decayRenderer); _decaySubPlot.setDomainCrosshairVisible(true); _decaySubPlot.setRangeCrosshairVisible(true); // add decay sub-plot to parent parent.add(_decaySubPlot, DECAY_WEIGHT); // create residual sub-plot final NumberAxis residualAxis = new NumberAxis(RESIDUAL_AXIS_LABEL); final XYSplineRenderer residualRenderer = new XYSplineRenderer(); residualRenderer.setSeriesPaint(0, RESIDUAL_COLOR); residualRenderer.setSeriesLinesVisible(0, false); residualRenderer.setSeriesShape(0, new Ellipse2D.Float(-1.0f, -1.0f, 2.0f, 2.0f)); final XYPlot residualSubPlot = new XYPlot(_residualDataset, null, residualAxis, residualRenderer); residualSubPlot.setDomainCrosshairVisible(true); residualSubPlot.setRangeCrosshairVisible(true); residualSubPlot.setFixedLegendItems(null); // add residual sub-plot to parent parent.add(residualSubPlot, RESIDUAL_WEIGHT); // now make the top level JFreeChart final JFreeChart chart = new JFreeChart(null, JFreeChart.DEFAULT_TITLE_FONT, parent, true); chart.removeLegend(); return chart; }