Example usage for org.jfree.chart ChartFactory createWaterfallChart

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

Introduction

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

Prototype

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

Source Link

Document

Creates a waterfall chart.

Usage

From source file:org.jfree.chart.demo.WaterfallChartDemo1.java

private static JFreeChart createChart(CategoryDataset categorydataset) {
    JFreeChart jfreechart = ChartFactory.createWaterfallChart("Product Cost Breakdown", "Expense Category",
            "Cost Per Unit", categorydataset, PlotOrientation.VERTICAL, false, true, false);
    jfreechart.setBackgroundPaint(Color.white);
    CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot();
    categoryplot.setBackgroundPaint(Color.lightGray);
    categoryplot.setRangeGridlinePaint(Color.white);
    categoryplot.setRangeGridlinesVisible(true);
    categoryplot.setAxisOffset(new RectangleInsets(5D, 5D, 5D, 5D));
    ValueAxis valueaxis = categoryplot.getRangeAxis();
    DecimalFormat decimalformat = new DecimalFormat("##,###");
    decimalformat.setNegativePrefix("(");
    decimalformat.setNegativeSuffix(")");
    TickUnits tickunits = new TickUnits();
    tickunits.add(new NumberTickUnit(5D, decimalformat));
    tickunits.add(new NumberTickUnit(10D, decimalformat));
    tickunits.add(new NumberTickUnit(20D, decimalformat));
    tickunits.add(new NumberTickUnit(50D, decimalformat));
    tickunits.add(new NumberTickUnit(100D, decimalformat));
    tickunits.add(new NumberTickUnit(200D, decimalformat));
    tickunits.add(new NumberTickUnit(500D, decimalformat));
    tickunits.add(new NumberTickUnit(1000D, decimalformat));
    tickunits.add(new NumberTickUnit(2000D, decimalformat));
    tickunits.add(new NumberTickUnit(5000D, decimalformat));
    valueaxis.setStandardTickUnits(tickunits);
    BarRenderer barrenderer = (BarRenderer) categoryplot.getRenderer();
    barrenderer.setDrawBarOutline(false);
    barrenderer.setBase(5D);//w w w . jav a2s.  c om
    DecimalFormat decimalformat1 = new DecimalFormat("$##,###.00");
    decimalformat1.setNegativePrefix("(");
    decimalformat1.setNegativeSuffix(")");
    barrenderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator("{2}", decimalformat1));
    barrenderer.setBaseItemLabelsVisible(true);
    return jfreechart;
}

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

public JFreeChart createChart() {
    JFreeChart chart = ChartFactory.createWaterfallChart(this.getTitle(), this.getCategoryAxisLabel(),
            this.getValueAxisLabel(), (CategoryDataset) this.getDataset(), this.getOrientation(),
            this.isLegend(), this.isTooltips(), this.isUrls());
    return setExtraProperties(chart);

}

From source file:org.pentaho.plugin.jfreereport.reportcharts.WaterfallChartExpressions.java

protected JFreeChart computeCategoryChart(final CategoryDataset dataset) {
    final JFreeChart chart = ChartFactory.createWaterfallChart(computeTitle(), getCategoryAxisLabel(),
            getValueAxisLabel(), dataset, computePlotOrientation(), isShowLegend(), false, false);
    chart.getCategoryPlot().setDomainAxis(new FormattedCategoryAxis(getCategoryAxisLabel(),
            getCategoricalAxisMessageFormat(), getRuntime().getResourceBundleFactory().getLocale()));
    return chart;
}

From source file:org.pentaho.chart.plugin.jfreechart.chart.bar.JFreeWaterfallBarChartGenerator.java

protected JFreeChart doCreateChart(final ChartDocumentContext chartDocContext, final ChartTableModel data) {
    final ChartDocument chartDocument = chartDocContext.getChartDocument();
    final String title = getTitle(chartDocument);
    final String valueCategoryLabel = getValueCategoryLabel(chartDocument);
    final String valueAxisLabel = getValueAxisLabel(chartDocument);
    final PlotOrientation orientation = getPlotOrientation(chartDocument);
    final boolean legend = getShowLegend(chartDocument);
    final boolean toolTips = getShowToolTips(chartDocument);

    final DefaultCategoryDataset categoryDataset = datasetGeneratorFactory
            .createDefaultCategoryDataset(chartDocContext, data);

    final JFreeChart chart = ChartFactory.createWaterfallChart(title, valueCategoryLabel, valueAxisLabel,
            categoryDataset, orientation, legend, toolTips, toolTips);

    final CategoryPlot categoryPlot = chart.getCategoryPlot();
    final ChartElement plotElement = chartDocument.getRootElement()
            .findChildrenByName(ChartElement.TAG_NAME_PLOT)[0];
    setPlotAttributes(categoryPlot, plotElement);
    final ChartElement[] seriesElements = chartDocument.getRootElement()
            .findChildrenByName(ChartElement.TAG_NAME_SERIES);
    if (categoryPlot != null && seriesElements != null) {
        setSeriesAttributes(seriesElements, data, categoryPlot);
    }//from w w  w .j ava2s. co  m

    return chart;
}

From source file:org.adempiere.apps.graph.GraphBuilder.java

private JFreeChart createWaterfallChart() {
    JFreeChart chart = ChartFactory.createWaterfallChart(m_goal.getMeasure().getName(), // chart title
            m_X_AxisLabel, // domain axis label
            m_Y_AxisLabel, // range axis label
            linearDataset, // data
            PlotOrientation.VERTICAL, // orientation
            false, // include legend
            true, // tooltips?
            true // URLs?
    );//from  w w  w.  j a v  a 2  s . c o  m

    setupCategoryChart(chart);
    return chart;
}

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

/**
 * Returns the chart./*w w  w. j a  v  a  2  s .  c o  m*/
 * 
 * @param dataset  the dataset.
 *
 * @return The chart.
 */
protected JFreeChart createChart(CategoryDataset dataset) {

    JFreeChart chart = ChartFactory.createWaterfallChart(chartTitle, domainLabel, rangeLabel, dataset,
            PlotOrientation.VERTICAL, !legendPanelOn, true, false);
    chart.setBackgroundPaint(Color.white);

    CategoryPlot plot = chart.getCategoryPlot();
    plot.setBackgroundPaint(Color.lightGray);
    plot.setRangeGridlinePaint(Color.white);
    plot.setRangeGridlinesVisible(true);
    plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));

    ValueAxis rangeAxis = plot.getRangeAxis();

    // create a custom tick unit collection...
    DecimalFormat formatter = new DecimalFormat("##,###");
    formatter.setNegativePrefix("(");
    formatter.setNegativeSuffix(")");
    TickUnits standardUnits = new TickUnits();
    standardUnits.add(new NumberTickUnit(5, formatter));
    standardUnits.add(new NumberTickUnit(10, formatter));
    standardUnits.add(new NumberTickUnit(20, formatter));
    standardUnits.add(new NumberTickUnit(50, formatter));
    standardUnits.add(new NumberTickUnit(100, formatter));
    standardUnits.add(new NumberTickUnit(200, formatter));
    standardUnits.add(new NumberTickUnit(500, formatter));
    standardUnits.add(new NumberTickUnit(1000, formatter));
    standardUnits.add(new NumberTickUnit(2000, formatter));
    standardUnits.add(new NumberTickUnit(5000, formatter));
    rangeAxis.setStandardTickUnits(standardUnits);

    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);
    renderer.setLegendItemLabelGenerator(new SOCRCategorySeriesLabelGenerator());

    DecimalFormat labelFormatter = new DecimalFormat("$##,###.00");
    labelFormatter.setNegativePrefix("(");
    labelFormatter.setNegativeSuffix(")");
    renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator("{2}", labelFormatter));
    renderer.setBaseItemLabelsVisible(true);

    setCategorySummary(dataset);
    return chart;
}

From source file:org.jfree.chart.demo.WaterfallChartDemo.java

/**
 * Returns the chart.//  w w  w.j a  v  a2  s . c o m
 * 
 * @param dataset  the dataset.
 *
 * @return The chart.
 */
private JFreeChart createChart(final CategoryDataset dataset) {

    final JFreeChart chart = ChartFactory.createWaterfallChart("Product Cost Breakdown", "Expense Category",
            "Cost Per Unit", dataset, PlotOrientation.VERTICAL, true, true, false);
    chart.setBackgroundPaint(Color.white);

    final CategoryPlot plot = chart.getCategoryPlot();
    plot.setBackgroundPaint(Color.lightGray);
    plot.setRangeGridlinePaint(Color.white);
    plot.setRangeGridlinesVisible(true);
    //        plot.setAxisOffset(new Spacer(Spacer.ABSOLUTE, 5.0, 5.0, 5.0, 5.0));

    final ValueAxis rangeAxis = plot.getRangeAxis();

    // create a custom tick unit collection...
    final DecimalFormat formatter = new DecimalFormat("##,###");
    formatter.setNegativePrefix("(");
    formatter.setNegativeSuffix(")");
    final TickUnits standardUnits = new TickUnits();
    standardUnits.add(new NumberTickUnit(5, formatter));
    standardUnits.add(new NumberTickUnit(10, formatter));
    standardUnits.add(new NumberTickUnit(20, formatter));
    standardUnits.add(new NumberTickUnit(50, formatter));
    standardUnits.add(new NumberTickUnit(100, formatter));
    standardUnits.add(new NumberTickUnit(200, formatter));
    standardUnits.add(new NumberTickUnit(500, formatter));
    standardUnits.add(new NumberTickUnit(1000, formatter));
    standardUnits.add(new NumberTickUnit(2000, formatter));
    standardUnits.add(new NumberTickUnit(5000, formatter));
    rangeAxis.setStandardTickUnits(standardUnits);

    final BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);

    final DecimalFormat labelFormatter = new DecimalFormat("$##,###.00");
    labelFormatter.setNegativePrefix("(");
    labelFormatter.setNegativeSuffix(")");
    //        renderer.setLabelGenerator(
    //          new StandardCategoryLabelGenerator("{2}", labelFormatter)
    //    );
    renderer.setItemLabelsVisible(true);

    return chart;
}

From source file:net.sf.jsfcomp.chartcreator.utils.ChartUtils.java

public static JFreeChart createChartWithCategoryDataSet(ChartData chartData) {
    JFreeChart chart = null;/*from w ww  . ja v  a 2  s.  c o m*/
    PlotOrientation plotOrientation = ChartUtils.getPlotOrientation(chartData.getOrientation());

    CategoryDataset dataset = (CategoryDataset) chartData.getDatasource();
    String type = chartData.getType();
    String xAxis = chartData.getXlabel();
    String yAxis = chartData.getYlabel();
    boolean is3d = chartData.isChart3d();
    boolean legend = chartData.isLegend();

    if (type.equalsIgnoreCase("bar")) {
        if (is3d == true) {
            chart = ChartFactory.createBarChart3D("", xAxis, yAxis, dataset, plotOrientation, legend, true,
                    false);
        } else {
            chart = ChartFactory.createBarChart("", xAxis, yAxis, dataset, plotOrientation, legend, true,
                    false);
        }
        setBarOutline(chart, chartData);
    } else if (type.equalsIgnoreCase("stackedbar")) {
        if (is3d == true) {
            chart = ChartFactory.createStackedBarChart3D("", xAxis, yAxis, dataset, plotOrientation, legend,
                    true, false);
        } else {
            chart = ChartFactory.createStackedBarChart("", xAxis, yAxis, dataset, plotOrientation, legend, true,
                    false);
        }
        setBarOutline(chart, chartData);
    } else if (type.equalsIgnoreCase("line")) {
        if (is3d == true)
            chart = ChartFactory.createLineChart3D("", xAxis, yAxis, dataset, plotOrientation, legend, true,
                    false);
        else
            chart = ChartFactory.createLineChart("", xAxis, yAxis, dataset, plotOrientation, legend, true,
                    false);
    } else if (type.equalsIgnoreCase("area")) {
        chart = ChartFactory.createAreaChart("", xAxis, yAxis, dataset, plotOrientation, legend, true, false);
    } else if (type.equalsIgnoreCase("stackedarea")) {
        chart = ChartFactory.createStackedAreaChart("", xAxis, yAxis, dataset, plotOrientation, legend, true,
                false);
    } else if (type.equalsIgnoreCase("waterfall")) {
        chart = ChartFactory.createWaterfallChart("", xAxis, yAxis, dataset, plotOrientation, legend, true,
                false);
    } else if (type.equalsIgnoreCase("gantt")) {
        chart = ChartFactory.createGanttChart("", xAxis, yAxis, (IntervalCategoryDataset) dataset, legend, true,
                false);
    }

    CategoryPlot plot = (CategoryPlot) chart.getCategoryPlot();
    plot.setDomainGridlinesVisible(chartData.isDomainGridLines());
    plot.setRangeGridlinesVisible(chartData.isRangeGridLines());
    if (chartData.getGenerateMap() != null)
        plot.getRenderer().setBaseItemURLGenerator(new StandardCategoryURLGenerator(""));

    int seriesCount = plot.getDataset().getColumnCount();
    if (chartData.getLineStokeWidth() > 0) {
        for (int index = 0; index <= seriesCount; index++)
            plot.getRenderer().setSeriesStroke(index, new BasicStroke(chartData.getLineStokeWidth()));
    }

    setCategorySeriesColors(chart, chartData);

    setCategoryExtensions(chart, chartData);

    return chart;
}

From source file:org.exist.xquery.modules.jfreechart.JFreeChartFactory.java

/**
 *  Create JFreeChart graph using the supplied parameters.
 *
 * @param chartType One of the many chart types.
 * @param conf      Chart configuration//from   ww w . j  av  a 2s  . c o  m
 * @param is        Inputstream containing chart data
 * @return          Initialized chart or NULL in case of issues.
 * @throws IOException Thrown when a problem is reported while parsing XML data.
 */
public static JFreeChart createJFreeChart(String chartType, Configuration conf, InputStream is)
        throws XPathException {

    logger.debug("Generating " + chartType);

    // Currently two dataset types supported
    CategoryDataset categoryDataset = null;
    PieDataset pieDataset = null;

    try {
        if ("PieChart".equals(chartType) || "PieChart3D".equals(chartType) || "RingChart".equals(chartType)) {
            logger.debug("Reading XML PieDataset");
            pieDataset = DatasetReader.readPieDatasetFromXML(is);

        } else {
            logger.debug("Reading XML CategoryDataset");
            categoryDataset = DatasetReader.readCategoryDatasetFromXML(is);
        }

    } catch (IOException ex) {
        throw new XPathException(ex.getMessage());

    } finally {
        try {
            is.close();
        } catch (IOException ex) {
            //
        }
    }

    // Return chart
    JFreeChart chart = null;

    // Big chart type switch
    if ("AreaChart".equalsIgnoreCase(chartType)) {
        chart = ChartFactory.createAreaChart(conf.getTitle(), conf.getCategoryAxisLabel(),
                conf.getValueAxisLabel(), categoryDataset, conf.getOrientation(), conf.isGenerateLegend(),
                conf.isGenerateTooltips(), conf.isGenerateUrls());

        setCategoryChartParameters(chart, conf);

    } else if ("BarChart".equalsIgnoreCase(chartType)) {
        chart = ChartFactory.createBarChart(conf.getTitle(), conf.getCategoryAxisLabel(),
                conf.getValueAxisLabel(), categoryDataset, conf.getOrientation(), conf.isGenerateLegend(),
                conf.isGenerateTooltips(), conf.isGenerateUrls());

        setCategoryChartParameters(chart, conf);

    } else if ("BarChart3D".equalsIgnoreCase(chartType)) {
        chart = ChartFactory.createBarChart3D(conf.getTitle(), conf.getCategoryAxisLabel(),
                conf.getValueAxisLabel(), categoryDataset, conf.getOrientation(), conf.isGenerateLegend(),
                conf.isGenerateTooltips(), conf.isGenerateUrls());

        setCategoryChartParameters(chart, conf);

    } else if ("LineChart".equalsIgnoreCase(chartType)) {
        chart = ChartFactory.createLineChart(conf.getTitle(), conf.getCategoryAxisLabel(),
                conf.getValueAxisLabel(), categoryDataset, conf.getOrientation(), conf.isGenerateLegend(),
                conf.isGenerateTooltips(), conf.isGenerateUrls());

        setCategoryChartParameters(chart, conf);

    } else if ("LineChart3D".equalsIgnoreCase(chartType)) {
        chart = ChartFactory.createLineChart3D(conf.getTitle(), conf.getCategoryAxisLabel(),
                conf.getValueAxisLabel(), categoryDataset, conf.getOrientation(), conf.isGenerateLegend(),
                conf.isGenerateTooltips(), conf.isGenerateUrls());

        setCategoryChartParameters(chart, conf);

    } else if ("MultiplePieChart".equalsIgnoreCase(chartType)) {
        chart = ChartFactory.createMultiplePieChart(conf.getTitle(), categoryDataset, conf.getOrder(),
                conf.isGenerateLegend(), conf.isGenerateTooltips(), conf.isGenerateUrls());

        setPieChartParameters(chart, conf);

    } else if ("MultiplePieChart3D".equalsIgnoreCase(chartType)) {
        chart = ChartFactory.createMultiplePieChart3D(conf.getTitle(), categoryDataset, conf.getOrder(),
                conf.isGenerateLegend(), conf.isGenerateTooltips(), conf.isGenerateUrls());

        setPieChartParameters(chart, conf);

    } else if ("PieChart".equalsIgnoreCase(chartType)) {
        chart = ChartFactory.createPieChart(conf.getTitle(), pieDataset, conf.isGenerateLegend(),
                conf.isGenerateTooltips(), conf.isGenerateUrls());

        setPieChartParameters(chart, conf);

    } else if ("PieChart3D".equalsIgnoreCase(chartType)) {
        chart = ChartFactory.createPieChart3D(conf.getTitle(), pieDataset, conf.isGenerateLegend(),
                conf.isGenerateTooltips(), conf.isGenerateUrls());

        setPieChartParameters(chart, conf);

    } else if ("RingChart".equalsIgnoreCase(chartType)) {
        chart = ChartFactory.createRingChart(conf.getTitle(), pieDataset, conf.isGenerateLegend(),
                conf.isGenerateTooltips(), conf.isGenerateUrls());

        setPieChartParameters(chart, conf);
    } else if ("SpiderWebChart".equalsIgnoreCase(chartType)) {
        SpiderWebPlot plot = new SpiderWebPlot(categoryDataset);
        if (conf.isGenerateTooltips()) {
            plot.setToolTipGenerator(new StandardCategoryToolTipGenerator());
        }
        chart = new JFreeChart(conf.getTitle(), JFreeChart.DEFAULT_TITLE_FONT, plot, false);

        if (conf.isGenerateLegend()) {
            LegendTitle legend = new LegendTitle(plot);
            legend.setPosition(RectangleEdge.BOTTOM);
            chart.addSubtitle(legend);
        } else {
            TextTitle subTitle = new TextTitle(" ");
            subTitle.setPosition(RectangleEdge.BOTTOM);
            chart.addSubtitle(subTitle);
        }

        setCategoryChartParameters(chart, conf);

    } else if ("StackedAreaChart".equalsIgnoreCase(chartType)) {
        chart = ChartFactory.createStackedAreaChart(conf.getTitle(), conf.getCategoryAxisLabel(),
                conf.getValueAxisLabel(), categoryDataset, conf.getOrientation(), conf.isGenerateLegend(),
                conf.isGenerateTooltips(), conf.isGenerateUrls());

        setCategoryChartParameters(chart, conf);

    } else if ("StackedBarChart".equalsIgnoreCase(chartType)) {
        chart = ChartFactory.createStackedBarChart(conf.getTitle(), conf.getDomainAxisLabel(),
                conf.getRangeAxisLabel(), categoryDataset, conf.getOrientation(), conf.isGenerateLegend(),
                conf.isGenerateTooltips(), conf.isGenerateUrls());

        setCategoryChartParameters(chart, conf);

    } else if ("StackedBarChart3D".equalsIgnoreCase(chartType)) {
        chart = ChartFactory.createStackedBarChart3D(conf.getTitle(), conf.getCategoryAxisLabel(),
                conf.getValueAxisLabel(), categoryDataset, conf.getOrientation(), conf.isGenerateLegend(),
                conf.isGenerateTooltips(), conf.isGenerateUrls());

        setCategoryChartParameters(chart, conf);

    } else if ("WaterfallChart".equalsIgnoreCase(chartType)) {
        chart = ChartFactory.createWaterfallChart(conf.getTitle(), conf.getCategoryAxisLabel(),
                conf.getValueAxisLabel(), categoryDataset, conf.getOrientation(), conf.isGenerateLegend(),
                conf.isGenerateTooltips(), conf.isGenerateUrls());

        setCategoryChartParameters(chart, conf);
    } else {
        logger.error("Illegal chartype. Choose one of " + "AreaChart BarChart BarChart3D LineChart LineChart3D "
                + "MultiplePieChart MultiplePieChart3D PieChart PieChart3D "
                + "RingChart SpiderWebChart StackedAreaChart StackedBarChart "
                + "StackedBarChart3D WaterfallChart");
    }

    setCommonParameters(chart, conf);

    return chart;
}

From source file:org.pentaho.reporting.engine.classic.extensions.legacy.charts.LegacyChartType.java

private JFreeChart createChart(final Expression aExpression) {
    if (aExpression instanceof BarLineChartExpression) {
        final CategoryAxis catAxis = new CategoryAxis("Category");// NON-NLS
        final NumberAxis barsAxis = new NumberAxis("Value");// NON-NLS
        final NumberAxis linesAxis = new NumberAxis("Value2");// NON-NLS

        final CategoryPlot plot = new CategoryPlot(createDataset(), catAxis, barsAxis, new BarRenderer());
        plot.setRenderer(1, new LineAndShapeRenderer());

        // add lines dataset and axis to plot
        plot.setDataset(1, createDataset());
        plot.setRangeAxis(1, linesAxis);

        // map lines to second axis
        plot.mapDatasetToRangeAxis(1, 1);

        // set rendering order
        plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);

        // set location of second axis
        plot.setRangeAxisLocation(1, AxisLocation.BOTTOM_OR_RIGHT);

        return new JFreeChart("Bar Line Chart", plot);
    }/*from www  .jav a  2  s . com*/

    if (aExpression instanceof RingChartExpression) {
        return ChartFactory.createRingChart("Ring Chart", createPieDataset(), true, false, false);// NON-NLS
    }
    if (aExpression instanceof AreaChartExpression) {
        return ChartFactory.createAreaChart("Area Chart", "Category", "Value", createDataset(),
                PlotOrientation.VERTICAL, true, false, false);// NON-NLS
    }
    if (aExpression instanceof BarChartExpression) {
        return ChartFactory.createBarChart("Bar Chart", "Category", "Value", createDataset(),
                PlotOrientation.VERTICAL, true, false, false);// NON-NLS

    }
    if (aExpression instanceof LineChartExpression) {
        return ChartFactory.createLineChart("Line Chart", "Category", "Value", createDataset(),
                PlotOrientation.VERTICAL, true, false, false);// NON-NLS
    }
    if (aExpression instanceof MultiPieChartExpression) {
        return ChartFactory.createMultiplePieChart("Multi Pie Chart", createDataset(), TableOrder.BY_COLUMN,
                true, false, false);// NON-NLS
    }
    if (aExpression instanceof PieChartExpression) {
        return ChartFactory.createPieChart("Pie Chart", createPieDataset(), true, false, false);// NON-NLS
    }
    if (aExpression instanceof WaterfallChartExpressions) {
        return ChartFactory.createWaterfallChart("Bar Chart", "Category", "Value", createDataset(),
                PlotOrientation.HORIZONTAL, true, false, false);// NON-NLS
    }
    if (aExpression instanceof BubbleChartExpression) {
        return ChartFactory.createBubbleChart("Bubble Chart", "X", "Y", createXYZDataset(),
                PlotOrientation.VERTICAL, true, false, false);// NON-NLS
    }
    if (aExpression instanceof ExtendedXYLineChartExpression) {
        return ChartFactory.createXYLineChart("XY Line Chart", "X", "Y", createXYZDataset(),
                PlotOrientation.VERTICAL, true, false, false);// NON-NLS
    }
    if (aExpression instanceof ScatterPlotChartExpression) {
        return ChartFactory.createScatterPlot("Scatter Chart", "X", "Y", createXYZDataset(),
                PlotOrientation.VERTICAL, true, false, false);// NON-NLS
    }
    if (aExpression instanceof XYAreaLineChartExpression) {
        final NumberAxis catAxis = new NumberAxis("Range");// NON-NLS
        final NumberAxis barsAxis = new NumberAxis("Value");// NON-NLS
        final NumberAxis linesAxis = new NumberAxis("Value2");// NON-NLS

        final XYPlot plot = new XYPlot(createXYZDataset(), catAxis, barsAxis, new XYAreaRenderer());
        plot.setRenderer(1, new XYLineAndShapeRenderer());

        // add lines dataset and axis to plot
        plot.setDataset(1, createXYZDataset());
        plot.setRangeAxis(1, linesAxis);

        // map lines to second axis
        plot.mapDatasetToRangeAxis(1, 1);

        // set rendering order
        plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);

        // set location of second axis
        plot.setRangeAxisLocation(1, AxisLocation.BOTTOM_OR_RIGHT);

        return new JFreeChart("XY Area Line Chart", plot);// NON-NLS
    }
    if (aExpression instanceof XYAreaChartExpression) {
        return ChartFactory.createXYAreaChart("XY Area Chart", "X", "Y", createXYZDataset(),
                PlotOrientation.VERTICAL, true, false, false);// NON-NLS
    }
    if (aExpression instanceof XYBarChartExpression) {
        return XYBarChartExpression.createXYBarChart("XY Bar Chart", "X", false, "Y", createIntervalXYDataset(),
                PlotOrientation.VERTICAL, true, false, false);// NON-NLS
    }
    if (aExpression instanceof XYLineChartExpression) {
        return ChartFactory.createXYLineChart("XY Line Chart", "X", "Y", createXYZDataset(),
                PlotOrientation.VERTICAL, true, false, false);// NON-NLS
    }
    if (aExpression instanceof RadarChartExpression) {
        final SpiderWebPlot plot = new SpiderWebPlot(createDataset());
        return new JFreeChart("Radar Chart", JFreeChart.DEFAULT_TITLE_FONT, plot, true);
    }
    if (aExpression instanceof ThermometerChartExpression) {
        final DefaultValueDataset dataset = new DefaultValueDataset(new Double(65.0));
        final ThermometerPlot plot = new ThermometerPlot(dataset);

        return new JFreeChart("Thermometer Chart", JFreeChart.DEFAULT_TITLE_FONT, plot, true);
    }
    return null;
}