Example usage for org.jfree.chart.plot XYPlot setBackgroundImageAlpha

List of usage examples for org.jfree.chart.plot XYPlot setBackgroundImageAlpha

Introduction

In this page you can find the example usage for org.jfree.chart.plot XYPlot setBackgroundImageAlpha.

Prototype

public void setBackgroundImageAlpha(float alpha) 

Source Link

Document

Sets the alpha transparency used when drawing the background image.

Usage

From source file:com.rapidminer.gui.viewer.metadata.model.NumericalAttributeStatisticsModel.java

/**
 * Creates the histogram chart./*from   w  w  w. j  av a 2  s. co m*/
 *
 * @param exampleSet
 * @return
 */
private JFreeChart createHistogramChart(ExampleSet exampleSet) {
    JFreeChart chart = ChartFactory.createHistogram(null, null, null, createHistogramDataset(exampleSet),
            PlotOrientation.VERTICAL, false, false, false);
    AbstractAttributeStatisticsModel.setDefaultChartFonts(chart);
    chart.setBackgroundPaint(null);
    chart.setBackgroundImageAlpha(0.0f);

    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setRangeGridlinesVisible(false);
    plot.setDomainGridlinesVisible(false);
    plot.setOutlineVisible(false);
    plot.setRangeZeroBaselineVisible(false);
    plot.setDomainZeroBaselineVisible(false);
    plot.setBackgroundPaint(COLOR_INVISIBLE);
    plot.setBackgroundImageAlpha(0.0f);

    XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer();
    renderer.setSeriesPaint(0, AttributeGuiTools.getColorForValueType(Ontology.NUMERICAL));
    renderer.setBarPainter(new StandardXYBarPainter());
    renderer.setDrawBarOutline(true);
    renderer.setShadowVisible(false);

    return chart;
}

From source file:com.rapidminer.gui.viewer.metadata.model.DateTimeAttributeStatisticsModel.java

/**
 * Creates the histogram chart.//from  w w  w . j  a  v a 2 s .c o m
 *
 * @param exampleSet
 * @return
 */
private JFreeChart createHistogramChart(final ExampleSet exampleSet) {
    JFreeChart chart = ChartFactory.createHistogram(null, null, null, createHistogramDataset(exampleSet),
            PlotOrientation.VERTICAL, false, false, false);
    AbstractAttributeStatisticsModel.setDefaultChartFonts(chart);
    chart.setBackgroundPaint(null);
    chart.setBackgroundImageAlpha(0.0f);

    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setRangeGridlinesVisible(false);
    plot.setDomainGridlinesVisible(false);
    plot.setOutlineVisible(false);
    plot.setRangeZeroBaselineVisible(false);
    plot.setDomainZeroBaselineVisible(false);
    plot.getDomainAxis().setTickLabelsVisible(false);
    plot.setBackgroundPaint(COLOR_INVISIBLE);
    plot.setBackgroundImageAlpha(0.0f);

    XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer();
    renderer.setSeriesPaint(0, AttributeGuiTools.getColorForValueType(Ontology.DATE_TIME));
    renderer.setBarPainter(new StandardXYBarPainter());
    renderer.setDrawBarOutline(true);
    renderer.setShadowVisible(false);

    return chart;
}

From source file:org.gvsig.gui.beans.graphic.GraphicChartPanel.java

/**
 * Creates a chart./*from   www  . java  2s. com*/
 * @param dataset the dataset.
 * @return A chart.
 */
private void createChart() {
    chart = ChartFactory.createXYLineChart(null, null, null, dataset, PlotOrientation.VERTICAL, false, true,
            true);

    // Definir la lista de colores
    XYPlot plot = chart.getXYPlot();
    plot.getRenderer().setSeriesPaint(0, Color.red);
    plot.getRenderer().setSeriesPaint(1, Color.green);
    plot.getRenderer().setSeriesPaint(2, Color.blue);
    plot.getRenderer().setSeriesPaint(3, Color.cyan);
    plot.getRenderer().setSeriesPaint(4, Color.black);
    plot.getRenderer().setSeriesPaint(5, Color.darkGray);
    plot.getRenderer().setSeriesPaint(6, Color.gray);
    plot.getRenderer().setSeriesPaint(7, Color.magenta);
    plot.getRenderer().setSeriesPaint(8, Color.yellow);
    plot.getRenderer().setSeriesPaint(9, Color.orange);

    Image img = new ImageIcon(getClass().getResource("images/splash.png")).getImage();
    plot.setBackgroundPaint(null);
    plot.setBackgroundImageAlpha(0.18f);
    plot.setBackgroundImage(img);
}