Example usage for org.jfree.chart ChartFactory createBarChart

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

Introduction

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

Prototype

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

Source Link

Document

Creates a bar chart.

Usage

From source file:br.com.utfpr.pb.view.GraficoTotalVendasView.java

public GraficoTotalVendasView() {
    try {//from ww  w.  jav a  2  s . com
        // cria o grfico
        JFreeChart grafico = ChartFactory.createBarChart("Total de Vendas vs Compras por Data", "Data",
                "Valor Total", graficoDao.totalVendasPorData(), PlotOrientation.VERTICAL, true, true, false);

        //exibe o grfico
        ChartFrame frame = new ChartFrame("Grfico", grafico);
        frame.pack();
        frame.setVisible(true);
        frame.setLocationRelativeTo(null);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:jfree.GraficoDeBarras.java

public GraficoDeBarras(String tituloGrafico, String label, float[][] valores) {
    super(tituloGrafico);
    convertirValoresADouble(valores);//from  w w w  .java  2  s. c o  m
    this.label = label;
    JFreeChart barChart = ChartFactory.createBarChart(tituloGrafico, "Intervalo", "Frecuencia", createDataset(),
            PlotOrientation.VERTICAL, true, true, false);

    ChartPanel chartPanel = new ChartPanel(barChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(560, 367));
    setContentPane(chartPanel);
    pack();
    RefineryUtilities.centerFrameOnScreen(this);
    setVisible(true);
}

From source file:br.com.utfpr.pb.view.GraficoQuantidadeVendasView.java

public GraficoQuantidadeVendasView() {
    try {//from w  ww.j av  a2 s  .  c  o m
        // cria o grfico
        JFreeChart grafico = ChartFactory.createBarChart("Nmero de Vendas vs Compras por Data", "Data",
                "Quantidade", graficoDao.quantidadeVendasPorData(), PlotOrientation.VERTICAL, true, true,
                false);

        //exibe o grfico
        ChartFrame frame = new ChartFrame("Grfico", grafico);
        frame.pack();
        frame.setVisible(true);
        frame.setLocationRelativeTo(null);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:br.com.utfpr.pb.view.GraficoProdutosMaisVendidosView.java

public GraficoProdutosMaisVendidosView() {
    try {//  w w  w.  j  av  a2  s. co  m
        // cria o grfico
        JFreeChart grafico = ChartFactory.createBarChart("Produtos mais Vendidos vs Comprados", "Produto",
                "Total venda", graficoDao.produtosMaisVendidos(), PlotOrientation.VERTICAL, true, true, false);

        //exibe o grfico
        ChartFrame frame = new ChartFrame("Grfico", grafico);
        frame.pack();
        frame.setVisible(true);
        frame.setLocationRelativeTo(null);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:chart.BarChart_AWT.java

public BarChart_AWT(String applicationTitle, String chartTitle) {
    super(applicationTitle);
    JFreeChart barChart = ChartFactory.createBarChart(chartTitle, "Category", "Score", createDataset(),
            PlotOrientation.VERTICAL, true, true, false);

    ChartPanel chartPanel = new ChartPanel(barChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(560, 367));
    setContentPane(chartPanel);//from w w  w  . j a va  2 s .  c  o m
}

From source file:nodeconfig.BarChart_fuzzy.java

public BarChart_fuzzy(String applicationTitle, String chartTitle) {
    super(applicationTitle);
    JFreeChart barChart = ChartFactory.createBarChart(chartTitle, "Nodes", "Fuzzy", createDataset(),
            PlotOrientation.VERTICAL, true, true, false);

    ChartPanel chartPanel = new ChartPanel(barChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(560, 367));
    setContentPane(chartPanel);/*ww w. ja v  a 2  s.c  o  m*/
}

From source file:ttma.client.GUI.StatFinance.java

public StatFinance(String applicationTitle, String chartTitle, String mois, String Anne) {
    super(applicationTitle);
    JFreeChart barChart = ChartFactory.createBarChart(chartTitle + " " + mois + " " + Anne, "Category", "TND",
            createDataset(), PlotOrientation.VERTICAL, true, true, false);

    ChartPanel chartPanel = new ChartPanel(barChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(700, 400));
    setContentPane(chartPanel);// w w  w. j a  va 2  s  .c  o  m
}

From source file:nodeconfig.BarChart_parameters.java

public BarChart_parameters(String applicationTitle, String chartTitle) {
    super(applicationTitle);
    JFreeChart barChart = ChartFactory.createBarChart(chartTitle, "Nodes", "Values", createDataset(),
            PlotOrientation.VERTICAL, true, true, false);

    ChartPanel chartPanel = new ChartPanel(barChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(560, 367));
    setContentPane(chartPanel);// w w w  . j  a  v  a  2s  .c o m
}

From source file:admin.gui.VMStateChartPanel.java

public VMStateChartPanel(Frame owner, String title, boolean modal, VirtualMachine vMachine) {
    super(owner, title, modal);
    JFreeChart barChart = ChartFactory.createBarChart("?", "", "?",
            createDataset(vMachine), PlotOrientation.VERTICAL, true, true, false);

    this.setMinimumSize(new java.awt.Dimension(400, 300));
    ChartPanel cp = new ChartPanel(barChart);
    setContentPane(cp);//from w  w w .j  av a2s  .  co  m
}

From source file:ec.display.chart.BarChartStatistics.java

public JFreeChart makeChart() {
    JFreeChart chart = ChartFactory.createBarChart(this.title, this.xlabel, this.ylabel, this.dataset,
            PlotOrientation.VERTICAL, false, true, false);

    return chart;
}