Example usage for org.jfree.chart.renderer.xy XYLineAndShapeRenderer setOutlineStroke

List of usage examples for org.jfree.chart.renderer.xy XYLineAndShapeRenderer setOutlineStroke

Introduction

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

Prototype

public void setOutlineStroke(Stroke stroke) 

Source Link

Document

Sets the outline stroke for ALL series and sends a RendererChangeEvent to all registered listeners.

Usage

From source file:com.github.dougkelly88.FLIMPlateReaderGUI.FLIMClasses.Classes.FindMaxpoint.java

/**
 * Creates a chart./*from w  w w .  j  a  v  a2  s  .co m*/
 * 
 * @param dataset  the data for the chart.
 * 
 * @return a chart.
 */
public JFreeChart createChart() {

    //http://www.java2s.com/Code/Java/Chart/JFreeChartDualAxisDemo2.htm
    String xlabel = "Delay (ps)";
    String ylabel = "Signal (DN)";

    // create the chart with findmaxpoint results
    final JFreeChart chart = ChartFactory.createXYLineChart(null, // chart title
            xlabel, // x axis label
            ylabel, // y axis label
            findMaxpointData_, // data
            PlotOrientation.VERTICAL, false, // include legend
            true, // tooltips
            false // urls
    );

    final XYPlot plot = chart.getXYPlot();
    // deal with axes and add second dataset
    final NumberAxis yaxis1 = (NumberAxis) plot.getRangeAxis();
    yaxis1.setTickLabelFont(new Font("Dialog", Font.PLAIN, 10));
    yaxis1.setLabelFont(new Font("Dialog", Font.PLAIN, 10));
    final NumberAxis yaxis2 = new NumberAxis(null);
    final NumberAxis xaxis = (NumberAxis) plot.getDomainAxis();
    xaxis.setTickLabelFont(new Font("Dialog", Font.PLAIN, 10));
    xaxis.setLabelFont(new Font("Dialog", Font.PLAIN, 10));
    plot.setRangeAxis(1, yaxis2);
    plot.setDataset(1, gatePositionData_);
    plot.mapDatasetToRangeAxis(1, 1);
    yaxis1.setRange(0, 5000);
    yaxis2.setRange(-1, 1);
    yaxis2.setTickLabelsVisible(false);
    xaxis.setRange(0, 16666);

    // deal with visuals

    final XYLineAndShapeRenderer renderer1 = new XYLineAndShapeRenderer(true, true);
    renderer1.setSeriesPaint(0, Color.RED);
    renderer1.setSeriesStroke(0, new BasicStroke(3));

    //        renderer1.setBaseShapesVisible(true);
    //        renderer1.setSeriesShape(0, ShapeUtilities.createDiagonalCross(4,1));

    plot.setRenderer(0, renderer1);

    //        final StandardXYItemRenderer renderer2 = new StandardXYItemRenderer();
    final XYLineAndShapeRenderer renderer2 = new XYLineAndShapeRenderer(false, true);
    renderer2.setSeriesPaint(0, Color.CYAN);
    renderer2.setSeriesShapesFilled(0, Boolean.TRUE);
    renderer2.setBaseShapesVisible(true);
    renderer2.setShape(new Rectangle(-2, -100, 4, 200));
    renderer2.setOutlineStroke(new BasicStroke(1));
    renderer2.setOutlinePaint(Color.GRAY);
    renderer2.setUseOutlinePaint(true);
    plot.setRenderer(1, renderer2);

    plot.setBackgroundPaint(Color.white);
    plot.setDomainGridlinePaint(Color.lightGray);
    plot.setRangeGridlinePaint(Color.lightGray);
    //                
    return chart;

}