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:userinterface.HospitalAdminRole.DataAnalysisHospitalJPanel.java

private void seeChartBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_seeChartBtnActionPerformed
    // TODO add your handling code here:

    int a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0;
    for (Network network : business.getNetworkList()) {

        for (Enterprise enterprise : network.getEnterpriseDirectory().getEnterpriseList()) {
            if (enterprise instanceof HospitalEnterprise) {
                for (Organization org : enterprise.getOrganizationDirectory().getOrganizationList()) {
                    for (WorkRequest request : org.getWorkQueue().getWorkRequestList()) {
                        String bg = request.getBloodGroup();
                        if (bg.equalsIgnoreCase("a+")) {
                            a++;/* www .ja  va 2s. c  o m*/
                        }

                        if (bg.equalsIgnoreCase("a-")) {
                            b++;
                        }

                        if (bg.equalsIgnoreCase("b+")) {
                            c++;
                        }

                        if (bg.equalsIgnoreCase("b-")) {
                            d++;
                        }

                        if (bg.equalsIgnoreCase("ab+")) {
                            e++;
                        }

                        if (bg.equalsIgnoreCase("ab-")) {
                            f++;
                        }

                        if (bg.equalsIgnoreCase("o+")) {
                            g++;
                        }

                        if (bg.equalsIgnoreCase("o-")) {
                            h++;
                        }

                    }
                }
            }
        }

        DefaultCategoryDataset dataset = new DefaultCategoryDataset();
        dataset.setValue(a, "Number", "A+");
        dataset.setValue(b, "Number", "A-");
        dataset.setValue(c, "Number", "B+");
        dataset.setValue(d, "Number", "B-");
        dataset.setValue(e, "Number", "AB+");
        dataset.setValue(f, "Number", "AB-");
        dataset.setValue(g, "Number", "O+");
        dataset.setValue(h, "Number", "O-");

        JFreeChart chart = ChartFactory.createBarChart("Hospital Demands", "Blood Types", "Number", dataset,
                PlotOrientation.VERTICAL, false, true, false);
        CategoryPlot p = chart.getCategoryPlot();
        p.setRangeGridlinePaint(Color.black);

        ChartFrame frame = new ChartFrame("Hospital Demands", chart);

        frame.setVisible(true);
        frame.setSize(450, 500);
    }

}

From source file:cglabsample.ui.HistogramWindow.java

private void updateHistogram() {
    if (!image.isGrayscale()) {
        image.toGrayscale();/* w  w w. j av a2  s.  c  o  m*/
    }
    ImageStatistics is = new ImageStatistics(image);
    Histogram h = is.getHistogramGray();
    double[] hvalues = new double[256];
    int[] hivalues = h.getValues();
    for (int i = 0; i < hivalues.length; i++) {
        hvalues[i] = (double) hivalues[i];
    }

    //        HistogramDataset dataset = new HistogramDataset();
    //        dataset.setType(HistogramType.FREQUENCY);
    //        dataset.addSeries("Histograma", hvalues, 256);
    //        String plotTitle = "Histograma";
    //        String xaxis = "intensidade";
    //        String yaxis = "frequencia";
    //        PlotOrientation orientation = PlotOrientation.VERTICAL;
    //        boolean show = false;
    //        boolean toolTips = false;
    //        boolean urls = false;
    //        JFreeChart chart = ChartFactory.createHistogram(plotTitle, xaxis, yaxis,
    //                dataset, orientation, show, toolTips, urls);
    //        ChartPanel cp = new ChartPanel(chart);
    //        setContentPane(cp);        

    DefaultCategoryDataset dataset = new DefaultCategoryDataset();

    for (int i = 0; i < 256; i++) {
        dataset.addValue(hvalues[i], "Histograma", "Histograma" + i);
    }

    String plotTitle = "Histograma";
    String xaxis = "intensidade";
    String yaxis = "frequencia";
    PlotOrientation orientation = PlotOrientation.VERTICAL;
    boolean show = false;
    boolean toolTips = false;
    boolean urls = false;
    JFreeChart chart = ChartFactory.createBarChart(plotTitle, xaxis, yaxis, dataset, orientation, show,
            toolTips, urls);
    ChartPanel cp = new ChartPanel(chart);
    cp.setPreferredSize(new Dimension(500, 270));
    setContentPane(cp);
}

From source file:ispd.gui.auxiliar.Graficos.java

public void criarProcessamento(Map<String, MetricasProcessamento> mProcess) {
    DefaultCategoryDataset dadosGraficoProcessamento = new DefaultCategoryDataset();
    DefaultPieDataset dadosGraficoPizzaProcessamento = new DefaultPieDataset();

    if (mProcess != null) {
        for (Map.Entry<String, MetricasProcessamento> entry : mProcess.entrySet()) {
            MetricasProcessamento mt = entry.getValue();
            if (mt.getnumeroMaquina() == 0) {
                dadosGraficoProcessamento.addValue(mt.getMFlopsProcessados(), "vermelho", mt.getId());
                dadosGraficoPizzaProcessamento.insertValue(0, mt.getId(), mt.getMFlopsProcessados());
            } else {
                dadosGraficoProcessamento.addValue(mt.getMFlopsProcessados(), "vermelho",
                        mt.getId() + " node " + mt.getnumeroMaquina());
                dadosGraficoPizzaProcessamento.insertValue(0, mt.getId() + " node " + mt.getnumeroMaquina(),
                        mt.getMFlopsProcessados());
            }//from  w w w.jav a  2  s.co m
        }
    }

    JFreeChart jfc = ChartFactory.createBarChart("Total processed on each resource", //Titulo
            "Resource", // Eixo X
            "Units", //Eixo Y
            dadosGraficoProcessamento, // Dados para o grafico
            PlotOrientation.VERTICAL, //Orientacao do grafico
            false, false, false); // exibir: legendas, tooltips, url
    //Inclina nome da barra em 45 graus
    if (mProcess != null && mProcess.size() > 10) {
        jfc.getCategoryPlot().getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.UP_45);
    }
    ProcessingBarChart = new ChartPanel(jfc);
    ProcessingBarChart.setPreferredSize(new Dimension(600, 300));

    jfc = ChartFactory.createPieChart("Total processed on each resource", //Titulo
            dadosGraficoPizzaProcessamento, // Dados para o grafico
            true, false, false);
    ProcessingPieChart = new ChartPanel(jfc);
    ProcessingPieChart.setPreferredSize(new Dimension(600, 300));

}

From source file:com.opensourcestrategies.crmsfa.reports.JFreeCrmsfaCharts.java

/**
 * Opportunities by stage.  Description at
 * http://www.opentaps.org/docs/index.php/CRMSFA_Dashboard
 * Note that this counts all the opportunities in the system for now.
 *///  ww w .  j  a  va2  s . c om
public static String createOpportunitiesbyStageChart(Delegator delegator, Locale locale)
        throws GenericEntityException, IOException {
    Map uiLabelMap = UtilMessage.getUiLabels(locale);

    DefaultCategoryDataset dataset = new DefaultCategoryDataset();

    String currency = UtilConfig.getPropertyValue("crmsfa", "defaultCurrencyUomId");

    // get all sales opportunity stages that are not closed, or lost
    List<GenericValue> salesOpportunityStages = ReportHelper
            .findSalesOpportunityStagesForDashboardReporting(delegator);

    // report number of leads for each status
    for (GenericValue stage : salesOpportunityStages) {
        String opportunityStageId = stage.getString("opportunityStageId");
        EntityCondition conditions = EntityCondition.makeCondition(EntityOperator.AND,
                EntityCondition.makeCondition("opportunityStageId", EntityOperator.EQUALS, opportunityStageId),
                EntityCondition.makeCondition("currencyUomId", EntityOperator.EQUALS, currency));
        List<GenericValue> salesOpportunityEstimatedAmountTotals = delegator
                .findByConditionCache("SalesOpportunityEstimatedAmountTotalByStage", conditions, null, null);

        if (salesOpportunityEstimatedAmountTotals != null && !salesOpportunityEstimatedAmountTotals.isEmpty()) {
            GenericValue salesOpportunityEstimatedAmountTotal = salesOpportunityEstimatedAmountTotals.get(0);
            dataset.addValue(salesOpportunityEstimatedAmountTotal.getDouble("estimatedAmountTotal"), "",
                    (String) stage.get("description", locale));
        } else {
            dataset.addValue(0, "", (String) stage.get("description", locale));
        }
    }

    // set up the chart
    JFreeChart chart = ChartFactory.createBarChart(
            (String) UtilMessage.expandLabel("CrmOpportunitiesbyStage", locale,
                    UtilMisc.toMap("currency", currency)),
            null, null, dataset, PlotOrientation.HORIZONTAL, false, true, false);
    chart.setBackgroundPaint(Color.white);
    chart.setBorderVisible(true);
    chart.setPadding(new RectangleInsets(5.0, 5.0, 5.0, 5.0));

    // get a reference to the plot for further customisation...
    final CategoryPlot plot = chart.getCategoryPlot();
    plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);

    // get the bar renderer to put effects on the bars
    final BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false); // disable bar outlines

    // set up gradient paint on bar
    final GradientPaint gp = new GradientPaint(0.0f, 0.0f, new Color(206, 246, 245), 0.0f, 0.0f,
            new Color(51, 204, 204));
    renderer.setSeriesPaint(0, gp);

    // change the auto tick unit selection to integer units only...
    final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    // save as a png and return the file name
    return ServletUtilities.saveChartAsPNG(chart, 360, 200, null);
}

From source file:Reportes.BarChart.java

public ChartPanel reporteOrdenesSede(DefaultCategoryDataset data) {
    JFreeChart chart = ChartFactory.createBarChart("Reporte de ordenes de trabajo por jefe", "Jefe de taller",
            "Cantidad", data, PlotOrientation.VERTICAL, true, true, true);

    CategoryPlot categoryP = chart.getCategoryPlot();
    BarRenderer renderer = (BarRenderer) categoryP.getRenderer();
    renderer.setMaximumBarWidth(0.35);/*from   w  w  w .  j a  v a2 s  . c om*/
    Color color = new Color(67, 165, 208);
    renderer.setSeriesPaint(0, color);

    ChartPanel panel = new ChartPanel(chart, true, true, true, false, false);
    panel.setSize(ancho, alto);

    return panel;
}

From source file:edu.ucla.stat.SOCR.chart.demo.BarChartDemo5.java

protected JFreeChart createLegend(CategoryDataset dataset) {

    //  JFreeChart chart = ChartFactory.createAreaChart(
    JFreeChart chart = ChartFactory.createBarChart(chartTitle, // chart title
            domainLabel, // domain axis label
            rangeLabel, // range axis label
            dataset, // data
            PlotOrientation.VERTICAL, // orientation
            true, // include legend
            true, // tooltips
            false // urls
    );/* w w w . jav  a 2  s  . com*/

    // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
    chart.setBackgroundPaint(Color.white);
    CategoryPlot plot = chart.getCategoryPlot();

    plot.getRenderer().setSeriesPaint(0, new Color(0, 0, 255));
    plot.getRenderer().setSeriesPaint(1, new Color(75, 75, 255));
    plot.getRenderer().setSeriesPaint(2, new Color(150, 150, 255));
    // renderer.setDrawOutlines(true);
    // renderer.setUseFillPaint(true);
    // renderer.setFillPaint(Color.white);
    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setLegendItemLabelGenerator(new SOCRCategorySeriesLabelGenerator());
    return chart;

}

From source file:br.com.OCTur.view.ContigenteController.java

@FXML
private void eCarregarGraficosActionEvent(ActionEvent actionEvent) {
    DefaultCategoryDataset dcdDados = new DefaultCategoryDataset();
    if (rbAeroporto.isSelected()) {
        if (inicio >= aeroportos.size() && !aeroportos.isEmpty()) {
            inicio = aeroportos.size() - 10;
        }/*w  w w  . j a v  a  2s . c  om*/
        for (EntidadeGrafico<Aeroporto> entidadegrafico : aeroportos.subList(inicio,
                inicio + 10 > aeroportos.size() ? aeroportos.size() : inicio + 10)) {
            if (entidadegrafico.getValue() >= MAX) {
                dcdDados.setValue(entidadegrafico.getValue(), "Pessoas/Maior", entidadegrafico.toString());
            } else if (entidadegrafico.getValue() <= MIN) {
                dcdDados.setValue(entidadegrafico.getValue(), "Pessoas/Menor", entidadegrafico.toString());
            } else {
                dcdDados.setValue(entidadegrafico.getValue(), "Pessoas", entidadegrafico.toString());
            }
        }
    } else if (rbCompanhia.isSelected()) {
        if (inicio >= companhias.size() && !companhias.isEmpty()) {
            inicio = companhias.size() - 10;
        }
        for (EntidadeGrafico<Companhia> entidadegrafico : companhias.subList(inicio,
                inicio + 10 > companhias.size() ? companhias.size() : inicio + 10)) {
            if (entidadegrafico.getValue() >= MAX) {
                dcdDados.setValue(entidadegrafico.getValue(), "Pessoas/Maior", entidadegrafico.toString());
            } else if (entidadegrafico.getValue() <= MIN) {
                dcdDados.setValue(entidadegrafico.getValue(), "Pessoas/Menor", entidadegrafico.toString());
            } else {
                dcdDados.setValue(entidadegrafico.getValue(), "Pessoas", entidadegrafico.toString());
            }
        }
    } else {
        if (inicio >= aviaos.size() && !aviaos.isEmpty()) {
            inicio = aviaos.size() - 10;
        }
        for (EntidadeGrafico<Aviao> entidadegrafico : aviaos.subList(inicio,
                inicio + 10 > aviaos.size() ? aviaos.size() : inicio + 10)) {
            if (entidadegrafico.getValue() >= MAX) {
                dcdDados.setValue(entidadegrafico.getValue(), "Pessoas/Maior", entidadegrafico.toString());
            } else if (entidadegrafico.getValue() <= MIN) {
                dcdDados.setValue(entidadegrafico.getValue(), "Pessoas/Menor", entidadegrafico.toString());
            } else {
                dcdDados.setValue(entidadegrafico.getValue(), "Pessoas", entidadegrafico.toString());
            }
        }
    }
    JFreeChart jFreeChart = ChartFactory.createBarChart("", "", "", dcdDados, PlotOrientation.VERTICAL, false,
            false, false);
    if (rbAviao.isSelected()) {
        jFreeChart.getCategoryPlot().getRangeAxis().setRange(new Range(0, 100));
        jFreeChart.getCategoryPlot().getRenderer().setBaseItemLabelGenerator(
                new StandardCategoryItemLabelGenerator("{2}%", NumberFormat.getInstance()));
        jFreeChart.getCategoryPlot().getRenderer().setBaseItemLabelsVisible(true);
    } else {
        jFreeChart.getCategoryPlot().getRenderer().setBaseItemLabelGenerator(
                new StandardCategoryItemLabelGenerator("{2}", NumberFormat.getInstance()));
        jFreeChart.getCategoryPlot().getRenderer().setBaseItemLabelsVisible(true);
    }
    ChartPanel chartPanel = new ChartPanel(jFreeChart);
    snGraficos.setContent(chartPanel);
    snGraficos.getContent().repaint();
}

From source file:net.sqs2.omr.result.export.chart.ChartImageWriter.java

public void saveBarChart(OutputStream outputStream, String categoryAxisLabel, String valueAxisLabel,
        DefaultCategoryDataset dataSet) {
    String title = "";

    boolean legend = false;
    boolean tooltips = true;
    boolean urls = false;

    JFreeChart chart = ChartFactory.createBarChart(title, categoryAxisLabel, valueAxisLabel, dataSet,
            PlotOrientation.HORIZONTAL, legend, tooltips, urls);
    CategoryPlot plot = chart.getCategoryPlot();
    setSectionPaint(dataSet, plot);/*from   ww  w  .j  a  va  2  s  .  com*/

    try {
        ChartUtilities.writeChartAsPNG(outputStream, chart, this.width, this.height);
    } catch (IOException ex) {
        ex.printStackTrace();
    }
}

From source file:org.mars_sim.msp.ui.swing.demo.BarChartDemo7.java

/**
 * Creates a sample chart.//ww w.  j av a 2  s.c o  m
 * 
 * @param dataset  the dataset.
 * 
 * @return The chart.
*/
private JFreeChart createChart(final CategoryDataset dataset) {

    // create the chart...
    final JFreeChart chart = ChartFactory.createBarChart("Bar Chart Demo 7", // chart title
            "Category", // domain axis label
            "Value", // range axis label
            dataset, // data
            PlotOrientation.VERTICAL, // orientation
            false, // include legend
            true, // tooltips?
            false // URLs?
    );

    // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...

    // set the background color for the chart...
    chart.setBackgroundPaint(Color.white);

    // get a reference to the plot for further customisation...
    final CategoryPlot plot = chart.getCategoryPlot();
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);

    final IntervalMarker target = new IntervalMarker(4.5, 7.5);
    target.setLabel("Target Range");
    target.setLabelFont(new Font("SansSerif", Font.ITALIC, 11));
    target.setLabelAnchor(RectangleAnchor.LEFT);
    target.setLabelTextAnchor(TextAnchor.CENTER_LEFT);
    target.setPaint(new Color(222, 222, 255, 128));
    plot.addRangeMarker(target, Layer.BACKGROUND);

    // set the range axis to display integers only...
    final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    // disable bar outlines...
    final BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);
    //renderer.setItemMargin(0.10);
    renderer.setMaximumBarWidth(.5); // set maximum width to 35% of chart

    // set up gradient paints for series...
    final GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.blue, 0.0f, 0.0f, Color.lightGray);
    final GradientPaint gp1 = new GradientPaint(0.0f, 0.0f, Color.green, 0.0f, 0.0f, Color.lightGray);
    final GradientPaint gp2 = new GradientPaint(0.0f, 0.0f, Color.red, 0.0f, 0.0f, Color.lightGray);
    renderer.setSeriesPaint(0, gp0);
    renderer.setSeriesPaint(1, gp1);
    renderer.setSeriesPaint(2, gp2);

    //      renderer.setLabelGenerator(new BarChartDemo7.LabelGenerator());
    renderer.setDefaultItemLabelsVisible(true);
    final ItemLabelPosition p = new ItemLabelPosition(ItemLabelAnchor.INSIDE12, TextAnchor.CENTER_RIGHT,
            TextAnchor.CENTER_RIGHT, -Math.PI / 2.0);
    renderer.setDefaultPositiveItemLabelPosition(p);

    final ItemLabelPosition p2 = new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.CENTER_LEFT,
            TextAnchor.CENTER_LEFT, -Math.PI / 2.0);
    renderer.setPositiveItemLabelPositionFallback(p2);
    final CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45);
    // OPTIONAL CUSTOMISATION COMPLETED.

    return chart;

}

From source file:de.laures.cewolf.taglib.CewolfChartFactory.java

public static JFreeChart getChartInstance(String chartType, String title, String xAxisLabel, String yAxisLabel,
        Dataset data) throws ChartValidationException {
    // first check the dynamically registered chart types
    CewolfChartFactory factory = (CewolfChartFactory) factories.get(chartType);
    if (factory != null) {
        // custom factory found, use it
        return factory.getChartInstance(title, xAxisLabel, yAxisLabel, data);
    }//  w  w  w  .ja  v  a2 s .c  om

    switch (getChartTypeConstant(chartType)) {
    case XY:
        check(data, XYDataset.class, chartType);
        return ChartFactory.createXYLineChart(title, xAxisLabel, yAxisLabel, (XYDataset) data,
                PlotOrientation.VERTICAL, true, true, true);
    case PIE:
        check(data, PieDataset.class, chartType);
        return ChartFactory.createPieChart(title, (PieDataset) data, true, true, true);
    case AREA_XY:
        check(data, XYDataset.class, chartType);
        return ChartFactory.createXYAreaChart(title, xAxisLabel, yAxisLabel, (XYDataset) data,
                PlotOrientation.VERTICAL, true, false, false);
    case SCATTER:
        check(data, XYDataset.class, chartType);
        return ChartFactory.createScatterPlot(title, xAxisLabel, yAxisLabel, (XYDataset) data,
                PlotOrientation.VERTICAL, true, false, false);
    case AREA:
        check(data, CategoryDataset.class, chartType);
        return ChartFactory.createAreaChart(title, xAxisLabel, yAxisLabel, (CategoryDataset) data,
                PlotOrientation.VERTICAL, true, false, false);
    case HORIZONTAL_BAR:
        check(data, CategoryDataset.class, chartType);
        return ChartFactory.createBarChart(title, xAxisLabel, yAxisLabel, (CategoryDataset) data,
                PlotOrientation.HORIZONTAL, true, false, false);
    case HORIZONTAL_BAR_3D:
        check(data, CategoryDataset.class, chartType);
        return ChartFactory.createBarChart3D(title, xAxisLabel, yAxisLabel, (CategoryDataset) data,
                PlotOrientation.HORIZONTAL, true, false, false);
    case LINE:
        check(data, CategoryDataset.class, chartType);
        return ChartFactory.createLineChart(title, xAxisLabel, yAxisLabel, (CategoryDataset) data,
                PlotOrientation.VERTICAL, true, false, false);
    case STACKED_HORIZONTAL_BAR:
        check(data, CategoryDataset.class, chartType);
        return ChartFactory.createStackedBarChart(title, xAxisLabel, yAxisLabel, (CategoryDataset) data,
                PlotOrientation.HORIZONTAL, true, false, false);
    case STACKED_VERTICAL_BAR:
        check(data, CategoryDataset.class, chartType);
        return ChartFactory.createStackedBarChart(title, xAxisLabel, yAxisLabel, (CategoryDataset) data,
                PlotOrientation.VERTICAL, true, false, false);
    case STACKED_VERTICAL_BAR_3D:
        check(data, CategoryDataset.class, chartType);
        return ChartFactory.createStackedBarChart3D(title, xAxisLabel, yAxisLabel, (CategoryDataset) data,
                PlotOrientation.VERTICAL, true, false, false);
    case VERTICAL_BAR:
        check(data, CategoryDataset.class, chartType);
        return ChartFactory.createBarChart(title, xAxisLabel, yAxisLabel, (CategoryDataset) data,
                PlotOrientation.VERTICAL, true, false, false);
    case VERTICAL_BAR_3D:
        check(data, CategoryDataset.class, chartType);
        return ChartFactory.createBarChart3D(title, xAxisLabel, yAxisLabel, (CategoryDataset) data,
                PlotOrientation.VERTICAL, true, false, false);
    case TIME_SERIES:
        check(data, XYDataset.class, chartType);
        return ChartFactory.createTimeSeriesChart(title, xAxisLabel, yAxisLabel, (XYDataset) data, true, false,
                false);
    case CANDLE_STICK:
        check(data, OHLCDataset.class, chartType);
        return ChartFactory.createCandlestickChart(title, xAxisLabel, yAxisLabel, (OHLCDataset) data, true);
    case HIGH_LOW:
        check(data, OHLCDataset.class, chartType);
        return ChartFactory.createHighLowChart(title, xAxisLabel, yAxisLabel, (OHLCDataset) data, true);
    case GANTT:
        check(data, IntervalCategoryDataset.class, chartType);
        return ChartFactory.createGanttChart(title, xAxisLabel, yAxisLabel, (IntervalCategoryDataset) data,
                true, false, false);
    case WIND:
        check(data, WindDataset.class, chartType);
        return ChartFactory.createWindPlot(title, xAxisLabel, yAxisLabel, (WindDataset) data, true, false,
                false);
    //case SIGNAL :
    //  check(data, SignalsDataset.class, chartType);
    //  return ChartFactory.createSignalChart(title, xAxisLabel, yAxisLabel, (SignalsDataset) data, true);
    case VERRTICAL_XY_BAR:
        check(data, IntervalXYDataset.class, chartType);
        return ChartFactory.createXYBarChart(title, xAxisLabel, true, yAxisLabel, (IntervalXYDataset) data,
                PlotOrientation.VERTICAL, true, false, false);
    case PIE_3D:
        check(data, PieDataset.class, chartType);
        return ChartFactory.createPieChart3D(title, (PieDataset) data, true, false, false);
    case METER:
        check(data, ValueDataset.class, chartType);
        MeterPlot plot = new MeterPlot((ValueDataset) data);
        JFreeChart chart = new JFreeChart(title, plot);
        return chart;
    case STACKED_AREA:
        check(data, CategoryDataset.class, chartType);
        return ChartFactory.createStackedAreaChart(title, xAxisLabel, yAxisLabel, (CategoryDataset) data,
                PlotOrientation.VERTICAL, true, false, false);
    case BUBBLE:
        check(data, XYZDataset.class, chartType);
        return ChartFactory.createBubbleChart(title, xAxisLabel, yAxisLabel, (XYZDataset) data,
                PlotOrientation.VERTICAL, true, false, false);

    case AUSTER_CICLOS:
        check(data, IntervalCategoryDataset.class, chartType);
        return ChartFactory.createAusterCiclosChart((IntervalCategoryDataset) data);

    default:
        throw new UnsupportedChartTypeException(chartType + " is not supported.");
    }
}