newChart.getTitle().getLabel().getCaption().setValue("Bar Chart Title");
newChart.getTitle().getLabel().getCaption().setValue(Messages.getString("BarChart.Txt.DefaultBarChartTitle"));
    public Chart getModel(String sSubType, Orientation orientation, String sDimension, Chart currentChart)    {        ChartWithAxes newChart = null;        if (currentChart != null)        {            newChart = (ChartWithAxes) getConvertedChart(currentChart, sSubType, orientation, sDimension);            if (newChart != null)            {                return newChart;            }        }        newChart = ChartWithAxesImpl.create();        newChart.setType(sType);        newChart.setSubType(sSubType);        newChart.setOrientation(orientation);        newChart.setDimension(getDimensionFor(sDimension));        newChart.setUnits("Points");        ((Axis) newChart.getAxes().get(0)).setOrientation(Orientation.HORIZONTAL_LITERAL);        ((Axis) newChart.getAxes().get(0)).setType(AxisType.TEXT_LITERAL);        ((Axis) newChart.getAxes().get(0)).setCategoryAxis(true);        SeriesDefinition sdX = SeriesDefinitionImpl.create();        Series categorySeries = SeriesImpl.create();        sdX.getSeries().add(categorySeries);        ((Axis) newChart.getAxes().get(0)).getSeriesDefinitions().add(sdX);        newChart.getTitle().getLabel().getCaption().setValue("Bar Chart Title");        if (sSubType.equalsIgnoreCase("Stacked"))        {            ((Axis) ((Axis) newChart.getAxes().get(0)).getAssociatedAxes().get(0))                .setOrientation(Orientation.VERTICAL_LITERAL);            ((Axis) ((Axis) newChart.getAxes().get(0)).getAssociatedAxes().get(0)).setType(AxisType.LINEAR_LITERAL);            SeriesDefinition sdY = SeriesDefinitionImpl.create();            sdY.getSeriesPalette().update(0);            Series valueSeries = BarSeriesImpl.create();            valueSeries.getLabel().setVisible(true);            valueSeries.setStacked(true);            sdY.getSeries().add(valueSeries);            ((Axis) ((Axis) newChart.getAxes().get(0)).getAssociatedAxes().get(0)).getSeriesDefinitions().add(sdY);        }        else if (sSubType.equalsIgnoreCase("Percent Stacked"))        {            ((Axis) ((Axis) newChart.getAxes().get(0)).getAssociatedAxes().get(0))                .setOrientation(Orientation.VERTICAL_LITERAL);            ((Axis) ((Axis) newChart.getAxes().get(0)).getAssociatedAxes().get(0)).setType(AxisType.LINEAR_LITERAL);            ((Axis) ((Axis) newChart.getAxes().get(0)).getAssociatedAxes().get(0)).setPercent(true);            SeriesDefinition sdY = SeriesDefinitionImpl.create();            sdY.getSeriesPalette().update(0);            Series valueSeries = BarSeriesImpl.create();            valueSeries.getLabel().setVisible(true);            valueSeries.setStacked(true);            ((BarSeries) valueSeries).setStacked(true);            sdY.getSeries().add(valueSeries);            ((Axis) ((Axis) newChart.getAxes().get(0)).getAssociatedAxes().get(0)).getSeriesDefinitions().add(sdY);        }        else if (sSubType.equalsIgnoreCase("Side-by-side"))        {            ((Axis) ((Axis) newChart.getAxes().get(0)).getAssociatedAxes().get(0))                .setOrientation(Orientation.VERTICAL_LITERAL);            ((Axis) ((Axis) newChart.getAxes().get(0)).getAssociatedAxes().get(0)).setType(AxisType.LINEAR_LITERAL);            SeriesDefinition sdY = SeriesDefinitionImpl.create();            sdY.getSeriesPalette().update(0);            Series valueSeries = BarSeriesImpl.create();            valueSeries.getLabel().setVisible(true);            ((BarSeries) valueSeries).setStacked(false);            sdY.getSeries().add(valueSeries);            ((Axis) ((Axis) newChart.getAxes().get(0)).getAssociatedAxes().get(0)).getSeriesDefinitions().add(sdY);        }        addSampleData(newChart);        return newChart;    }