Example usage for org.jfree.chart ChartFactory createStackedBarChart3D

List of usage examples for org.jfree.chart ChartFactory createStackedBarChart3D

Introduction

In this page you can find the example usage for org.jfree.chart ChartFactory createStackedBarChart3D.

Prototype

public static JFreeChart createStackedBarChart3D(String title, String categoryAxisLabel, String valueAxisLabel,
        CategoryDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) 

Source Link

Document

Creates a stacked bar chart with a 3D effect and default settings.

Usage

From source file:com.thecoderscorner.groovychart.chart.StackedBarChart3D.java

public JFreeChart createChart() {
    return ChartFactory.createStackedBarChart3D(getTitle(), this.getDomainAxisLabel(), this.getRangeAxisLabel(),
            (CategoryDataset) this.getDataset(), this.getOrientation(), this.isLegend(), this.isTooltips(),
            this.isUrls());
}

From source file:fuel.gui.stats.BarChartPanel.java

public BarChartPanel(DefaultCategoryDataset barDataset, String message, boolean stacked) {
    JFreeChart barChart;/*from w w w  .  ja  v  a  2s . c  o m*/
    if (stacked) {
        barChart = ChartFactory.createStackedBarChart3D("", // chart title
                "", // domain axis label
                "", // range axis label
                barDataset, // data
                PlotOrientation.VERTICAL, true, // include legend
                true, // tooltips?
                true // URLs?
        );
    } else {
        barChart = ChartFactory.createBarChart3D("", // chart title
                "", // domain axis label
                "", // range axis label
                barDataset, // data
                PlotOrientation.VERTICAL, false, // include legend
                true, // tooltips?
                true // URLs?
        );
    }
    CategoryPlot plot = barChart.getCategoryPlot();
    BarRenderer3D renderer = (BarRenderer3D) plot.getRenderer();
    renderer.setDrawBarOutline(false);
    final CategoryAxis domainAxis = plot.getDomainAxis();
    double count = barDataset.getColumnCount();
    double extra = 16 / count;
    domainAxis.setCategoryLabelPositions(
            CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / (2 + extra)));

    ChartPanel barChartPanel = new ChartPanel(barChart);
    barChartPanel.getChartRenderingInfo().setEntityCollection(null);
    barChartPanel.setBorder(BorderFactory.createTitledBorder(message));
    int wider = barDataset.getColumnCount() * 12;
    barChartPanel.setPreferredSize(new java.awt.Dimension(192 + wider, 240));
    barChartPanel.setLayout(new BorderLayout());
    setLayout(new BorderLayout());
    add(barChartPanel);
}

From source file:de.berlios.statcvs.xml.chart.AbstractStackedChart.java

/**
 * @param filename/*from   w w  w.ja va  2s  .co m*/
 * @param title
 */
public AbstractStackedChart(ReportSettings settings, String filename, String title, String domainLabel,
        String rangeLabel) {
    super(settings, filename, title);

    dataset = new DefaultCategoryDataset();
    setChart(ChartFactory.createStackedBarChart3D(settings.getProjectName(), // chart title
            domainLabel, rangeLabel, dataset, // data
            PlotOrientation.HORIZONTAL, true, // include legend
            true, // tooltips
            false)); // urls
}

From source file:com.manydesigns.portofino.chart.ChartStackedBar3DGenerator.java

protected JFreeChart createChart(ChartDefinition chartDefinition, CategoryDataset dataset,
        PlotOrientation plotOrientation) {
    return ChartFactory.createStackedBarChart3D(chartDefinition.getName(), chartDefinition.getXAxisName(),
            chartDefinition.getYAxisName(), dataset, plotOrientation, true, true, true);
}

From source file:org.jw.service.factory.StatisticsChartFactory.java

public static JFreeChart createStackedBarChart3D(CategoryDataset dataset, String title,
        String categoryAxisLabel, String valueAxisLabel, PlotOrientation orientation) {
    JFreeChart chart = ChartFactory.createStackedBarChart3D(title, categoryAxisLabel, valueAxisLabel, dataset,
            orientation, true, true, true);
    return chart;
}

From source file:net.sf.statcvs.output.xml.chart.AbstractStackedChart.java

/**
 * /*from   w  w w .j a v  a2  s  .c  o m*/
 */
private void createChart() {
    // create the chart...
    JFreeChart chart = ChartFactory.createStackedBarChart3D(Settings.getProjectName(), // chart title
            "no desc", // domain axis label
            "no desc", // range axis label
            dataset, // data
            PlotOrientation.VERTICAL, true, // include legend
            true, // tooltips
            false // urls
    );
    setChart(chart);
}

From source file:org.operamasks.faces.render.graph.BarChartRenderer.java

protected JFreeChart createChart(UIChart comp) {
    Dataset dataset = createDataset(comp);
    JFreeChart chart = null;//from   www  .  j  a  v a 2  s . c  o m

    if (dataset instanceof CategoryDataset) {
        if (comp.isStacked()) {
            if (comp.isEffect3D()) {
                chart = ChartFactory.createStackedBarChart3D(null, null, null, (CategoryDataset) dataset,
                        getChartOrientation(comp), false, false, false);
            } else {
                chart = ChartFactory.createStackedBarChart(null, null, null, (CategoryDataset) dataset,
                        getChartOrientation(comp), false, false, false);
            }
        } else {
            if (comp.isEffect3D()) {
                chart = ChartFactory.createBarChart3D(null, null, null, (CategoryDataset) dataset,
                        getChartOrientation(comp), false, false, false);
            } else {
                chart = ChartFactory.createBarChart(null, null, null, (CategoryDataset) dataset,
                        getChartOrientation(comp), false, false, false);
            }
        }
    } else if (dataset instanceof IntervalXYDataset) {
        chart = ChartFactory.createXYBarChart(null, null, (dataset instanceof TimeSeriesCollection), null,
                (IntervalXYDataset) dataset, getChartOrientation(comp), false, false, false);
    }

    return chart;
}

From source file:sernet.gs.ui.rcp.main.bsi.views.chart.StufenBarChart.java

protected JFreeChart createBarChart(Object dataset) {
    final float plotForegroundAlpha = 0.6f;
    JFreeChart chart = ChartFactory.createStackedBarChart3D(null, Messages.StufenBarChart_1,
            Messages.StufenBarChart_2, (CategoryDataset) dataset, PlotOrientation.HORIZONTAL, false, true,
            false);//from   ww  w  .j  a  va 2s  .  c  o m
    chart.setBackgroundPaint(Color.white);
    chart.getPlot().setForegroundAlpha(plotForegroundAlpha);
    chart.setBackgroundPaint(Color.white);
    CategoryPlot plot = (CategoryPlot) chart.getPlot();

    plot.getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.STANDARD);
    return chart;

}

From source file:sernet.gs.ui.rcp.main.bsi.views.chart.UmsetzungBarChart.java

protected JFreeChart createBarChart(Object dataset) {
    final float plotForegroundAlpha = 0.6f;
    JFreeChart chart = ChartFactory.createStackedBarChart3D(null, Messages.UmsetzungBarChart_1,
            Messages.UmsetzungBarChart_2, (CategoryDataset) dataset, PlotOrientation.HORIZONTAL, false, true,
            false);/* w  w  w .j  a v a 2  s  .  c  o  m*/
    chart.setBackgroundPaint(Color.white);
    chart.getPlot().setForegroundAlpha(plotForegroundAlpha);
    chart.setBackgroundPaint(Color.white);
    CategoryPlot plot = (CategoryPlot) chart.getPlot();

    plot.getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.STANDARD);
    return chart;

}

From source file:gchisto.gui.panels.gcstats.BreakdownChartPanelMulti.java

/**
 * It creates a chart for the given dataset and adds the chart to the panel.
 *
 * @param dataset The dataset that will provide the values for the chart.
 */// w  w w  .  jav a  2s  .  c om
private void addChart() {
    JFreeChart chart = ChartFactory.createStackedBarChart3D(getTitle(), null, "Breakdown" + unitSuffix(),
            dataset, PlotOrientation.VERTICAL, true, true, false);
    CategoryAxis domainAxis = chart.getCategoryPlot().getDomainAxis();
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0));
    chart.addProgressListener(locker);
    CategoryPlot plot = (CategoryPlot) chart.getPlot();
    CategoryItemRenderer renderer = plot.getRenderer();
    renderer.setToolTipGenerator(dataset);

    mainPanel().add(BorderLayout.CENTER, new ChartPanel(chart));
}