Example usage for org.jfree.chart.plot WaferMapPlot setRenderer

List of usage examples for org.jfree.chart.plot WaferMapPlot setRenderer

Introduction

In this page you can find the example usage for org.jfree.chart.plot WaferMapPlot setRenderer.

Prototype

public void setRenderer(WaferMapRenderer renderer) 

Source Link

Document

Sets the item renderer, and notifies all listeners of a change to the plot.

Usage

From source file:org.hxzon.demo.jfreechart.OtherDatasetDemo.java

private static JFreeChart createWaferMapChart(WaferMapDataset dataset) {
    WaferMapPlot plot = new WaferMapPlot(dataset);
    WaferMapRenderer renderer = new WaferMapRenderer();
    plot.setRenderer(renderer);

    JFreeChart chart = new JFreeChart("WaferMap Chart Demo", JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    chart.setBackgroundPaint(Color.white);

    plot.setBackgroundPaint(Color.lightGray);

    return chart;
}

From source file:edu.dlnu.liuwenpeng.ChartFactory.ChartFactory.java

/**    
 * Creates a wafer map chart.    /*from   ww w .  j  av  a 2  s  . com*/
 *    
 * @param title  the chart title (<code>null</code> permitted).    
 * @param dataset  the dataset (<code>null</code> permitted).    
 * @param orientation  the plot orientation (horizontal or vertical)     
 *                     (<code>null</code> NOT permitted.    
 * @param legend  display a legend?    
 * @param tooltips  generate tooltips?    
 * @param urls  generate URLs?    
 *    
 * @return A wafer map chart.    
 */
public static JFreeChart createWaferMapChart(String title, WaferMapDataset dataset, PlotOrientation orientation,
        boolean legend, boolean tooltips, boolean urls) {

    if (orientation == null) {
        throw new IllegalArgumentException("Null 'orientation' argument.");
    }
    WaferMapPlot plot = new WaferMapPlot(dataset);
    WaferMapRenderer renderer = new WaferMapRenderer();
    plot.setRenderer(renderer);

    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);

    return chart;
}

From source file:KIDLYFactory.java

/**
 * Creates a wafer map chart.//ww  w.  j  a  v  a 2s.  co  m
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param dataset  the dataset (<code>null</code> permitted).
 * @param orientation  the plot orientation (horizontal or vertical)
 *                     (<code>null</code> NOT permitted.
 * @param legend  display a legend?
 * @param tooltips  generate tooltips?
 * @param urls  generate URLs?
 *
 * @return A wafer map chart.
 */
public static JFreeChart createWaferMapChart(String title, WaferMapDataset dataset, PlotOrientation orientation,
        boolean legend, boolean tooltips, boolean urls) {

    if (orientation == null) {
        throw new IllegalArgumentException("Null 'orientation' argument.");
    }
    WaferMapPlot plot = new WaferMapPlot(dataset);
    WaferMapRenderer renderer = new WaferMapRenderer();
    plot.setRenderer(renderer);

    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    currentTheme.apply(chart);
    return chart;
}

From source file:org.jfree.chart.demo.JFreeChartDemoBase.java

/**
 * Creates a basic wafermap chart with a random dataset
 *
 * @return a wafermap chart/* w w  w  .  ja  v  a2  s .  c om*/
 */
public JFreeChart createWaferMapChartPositionIndexed() {
    final WaferMapDataset dataset = DemoDatasetFactory.createRandomWaferMapDataset(500);
    final WaferMapPlot plot = new WaferMapPlot(dataset);
    final WaferMapRenderer renderer = new WaferMapRenderer(35, WaferMapRenderer.POSITION_INDEX);
    plot.setRenderer(renderer);

    final JFreeChart chart = new JFreeChart("Wafer Map Demo - Position Indexed", JFreeChart.DEFAULT_TITLE_FONT,
            plot, true);

    //    final Legend legend = chart.getLegend();
    //  legend.setAnchor(Legend.EAST);
    chart.setBackgroundPaint(new GradientPaint(0, 0, Color.white, 0, 1000, Color.blue));

    final TextTitle copyright = new TextTitle("JFreeChart WaferMapPlot", new Font("SansSerif", Font.PLAIN, 9));
    copyright.setPosition(RectangleEdge.BOTTOM);
    copyright.setHorizontalAlignment(HorizontalAlignment.RIGHT);
    chart.addSubtitle(copyright);

    return chart;
}

From source file:org.jfree.chart.ChartFactory.java

/**
 * Creates a wafer map chart./*w w  w. j  a  va 2s . c  o m*/
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param dataset  the dataset (<code>null</code> permitted).
 *
 * @return A wafer map chart.
 */
public static JFreeChart createWaferMapChart(String title, WaferMapDataset dataset) {

    WaferMapPlot plot = new WaferMapPlot(dataset);
    WaferMapRenderer renderer = new WaferMapRenderer();
    plot.setRenderer(renderer);

    JFreeChart chart = new JFreeChart(title, plot);
    currentTheme.apply(chart);
    return chart;
}