Example usage for org.jfree.chart.plot CombinedDomainXYPlot setForegroundAlpha

List of usage examples for org.jfree.chart.plot CombinedDomainXYPlot setForegroundAlpha

Introduction

In this page you can find the example usage for org.jfree.chart.plot CombinedDomainXYPlot setForegroundAlpha.

Prototype

public void setForegroundAlpha(float alpha) 

Source Link

Document

Sets the alpha-transparency for the plot and sends a PlotChangeEvent to all registered listeners.

Usage

From source file:org.ietr.preesm.mapper.ui.stats.PerformancePlotter.java

/**
 * Creates a chart in order to plot the speed-ups.
 * //from w ww. ja  v  a 2  s .  co m
 * @return A chart.
 */
private JFreeChart createChart(String title) {

    // Creating display domain
    NumberAxis horizontalAxis = new NumberAxis("Number of operators");
    final CombinedDomainXYPlot plot = new CombinedDomainXYPlot(horizontalAxis);

    // Creating the best speedups subplot
    this.speedups = new DefaultXYDataset();

    final NumberAxis xAxis = new NumberAxis("speedups");

    xAxis.setAutoRangeIncludesZero(false);

    XYSplineRenderer renderer = new XYSplineRenderer();
    final XYPlot subplot = new XYPlot(this.speedups, null, xAxis, renderer);

    subplot.setBackgroundPaint(Color.white);
    subplot.setDomainGridlinePaint(Color.lightGray);
    subplot.setRangeGridlinePaint(Color.lightGray);
    plot.add(subplot);

    plot.setForegroundAlpha(0.5f);

    final JFreeChart chart = new JFreeChart(title, plot);

    chart.setBorderPaint(Color.white);
    chart.setBorderVisible(true);
    chart.setBackgroundPaint(Color.white);

    plot.setBackgroundPaint(Color.white);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);

    final ValueAxis axis = plot.getDomainAxis();
    axis.setAutoRange(true);

    return chart;

}