Example usage for org.jfree.chart JFreeChart setTitle

List of usage examples for org.jfree.chart JFreeChart setTitle

Introduction

In this page you can find the example usage for org.jfree.chart JFreeChart setTitle.

Prototype

public void setTitle(String text) 

Source Link

Document

Sets the chart title and sends a ChartChangeEvent to all registered listeners.

Usage

From source file:org.psystems.dicom.browser.server.stat.StatDailyLoadChartServlet.java

public JFreeChart getChart(CategoryDataset dataset) {
    // create the chart...
    final JFreeChart chart = ChartFactory.createBarChart3D(" ", // chart title
            "", // domain axis label
            " (.)", // range axis label
            dataset, // data
            PlotOrientation.VERTICAL, // orientation
            true, // include legend
            true, // tooltips?
            false // URLs?
    );//from   ww w.  ja v  a 2  s  .c  o  m

    //      #44639C;

    TextTitle title = new TextTitle("  ", labelFont);
    //      Paint paint = title.getPaint();
    title.setPaint(new Color(68, 99, 156));
    chart.setTitle(title);

    // 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(2000000, 3000000);
    // target.setLabel(" ");
    // 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());
    rangeAxis.setTickLabelFont(labelFont);

    // disable bar outlines...
    final BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);
    renderer.setItemMargin(0.10);

    // set up gradient paints for series...
    final GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.blue, 0.0f, 0.0f, Color.blue);
    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);

    final CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 4.0)
    // CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0)
    );
    // OPTIONAL CUSTOMISATION COMPLETED.

    return chart;
}

From source file:YoungDoubleSlit.YoungDoubleSlit.java

public JFreeChart getResultChart() {
    // XY ?.//from www  .j a v  a2  s  . c o m
    XYSeries series = new XYSeries("Histogram of light amplitude");
    Integer radius_size = ((UpperViewPane) upperView).getRadius().size();
    Integer wavelength_value = ((UpperViewPane) upperView).getWavelengths().get(0);
    Double bin_width = 31.0 / bin_size;

    for (int i = 0; i < bin_size; i++) {
        double theta = Math.toRadians(-15.5 + bin_width * i);
        //double alpha = Math.PI* slit_width/wavelength_value*Math.sin(theta);
        //double beta  = Math.PI* slit_distance/wavelength_value*Math.sin(theta);
        double alpha = Math.PI * slit_width * Math.sin(theta);
        double beta = Math.PI * slit_distance * Math.sin(theta);
        double amplitude = Math.cos(beta) * Math.cos(beta) * (Math.sin(alpha) / alpha)
                * (Math.sin(alpha) / alpha);
        // series? (x,y) ? 
        series.add(theta, amplitude);
    }
    // XY Dataset  
    XYSeriesCollection data = new XYSeriesCollection(series);
    final JFreeChart chart = ChartFactory.createXYLineChart("Amplitude of Light", "Angle", "Amp.", data,
            PlotOrientation.VERTICAL, true, true, false);
    chart.setTitle("Amplitude of light"); //  ?
    return chart;

}

From source file:com.appnativa.rare.ui.chart.jfreechart.ChartHelper.java

public static void setChartTitle(JFreeChart chart, RenderableDataItem title) {
    if (title == null) {
        return;//  w  ww .  j  a v a2  s . co  m
    }

    TextTitle tt = new TextTitle(title.toString());

    if (title.getFont() != null) {
        tt.setFont(title.getFont());
    }

    if (title.getForeground() != null) {
        tt.setPaint(title.getForeground());
    }

    switch (title.getIconPosition()) {
    case TOP_CENTER:
        tt.setPosition(RectangleEdge.TOP);

        break;

    case RIGHT:
        tt.setPosition(RectangleEdge.RIGHT);

        break;

    case BOTTOM_CENTER:
        tt.setPosition(RectangleEdge.BOTTOM);

        break;

    case LEFT:
        tt.setPosition(RectangleEdge.LEFT);

        break;

    default:
        break;
    }

    chart.setTitle(tt);
}

From source file:de.atomfrede.tools.evalutation.tools.plot.custom.CustomSimplePlot.java

@Override
protected JFreeChart createChart(XYDatasetWrapper... datasetWrappers) {
    XYDatasetWrapper mainDataset = datasetWrappers[0];

    JFreeChart chart = ChartFactory.createXYLineChart(mainDataset.getSeriesName(), "Index",
            mainDataset.getSeriesName(), mainDataset.getDataset(), PlotOrientation.VERTICAL, true, false,
            false);//from ww  w  .  j  av  a  2  s .c  o m

    XYPlot plot = (XYPlot) chart.getPlot();
    // all adjustments for first/main dataset
    plot.getRangeAxis(0).setLowerBound(mainDataset.getMinimum());
    plot.getRangeAxis(0).setUpperBound(mainDataset.getMaximum());
    // some additional "design" stuff for the plot
    plot.getRenderer(0).setSeriesPaint(0, mainDataset.getSeriesColor());
    plot.getRenderer(0).setSeriesStroke(0, new BasicStroke(mainDataset.getStroke()));

    for (int i = 1; i < datasetWrappers.length; i++) {
        XYDatasetWrapper wrapper = datasetWrappers[i];
        plot.setDataset(i, wrapper.getDataset());
        chart.setTitle(chart.getTitle().getText() + "/" + wrapper.getSeriesName());

        NumberAxis axis = new NumberAxis(wrapper.getSeriesName());
        plot.setRangeAxis(i, axis);
        plot.setRangeAxisLocation(i, AxisLocation.BOTTOM_OR_RIGHT);

        plot.getRangeAxis(i).setLowerBound(wrapper.getMinimum() - 15.0);
        plot.getRangeAxis(i).setUpperBound(wrapper.getMaximum() + 15.0);
        // map the second dataset to the second axis
        plot.mapDatasetToRangeAxis(i, i);

        XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
        renderer.setBaseShapesVisible(false);
        renderer.setSeriesStroke(0, new BasicStroke(wrapper.getStroke()));
        plot.setRenderer(i, renderer);
        plot.getRenderer(i).setSeriesPaint(0, wrapper.getSeriesColor());
    }
    // change the background and gridline colors
    plot.setBackgroundPaint(Color.white);
    plot.setDomainMinorGridlinePaint(Color.LIGHT_GRAY);
    plot.setDomainGridlinePaint(Color.LIGHT_GRAY);
    plot.setRangeGridlinePaint(Color.LIGHT_GRAY);

    return chart;
}

From source file:org.pentaho.platform.uifoundation.chart.JFreeChartEngine.java

private static JFreeChart createMultiplePieChart(final CategoryDatasetChartDefinition chartDefinition) {
    // TODO Make the following accessible from the chartDefinition
    TableOrder order = TableOrder.BY_ROW;
    // boolean tooltips = true;
    // boolean urls = true;
    // -----------------------------------------------------------

    String title = chartDefinition.getTitle();
    boolean legend = chartDefinition.isLegendIncluded();

    if (order == null) {
        throw new IllegalArgumentException(
                Messages.getInstance().getString("JFreeChartEngine.ERROR_0001_NULL_ORDER_ARGUMENT")); //$NON-NLS-1$
    }/* w w  w  . j  a  v  a  2s. co  m*/
    MultiplePiePlot plot = new MultiplePiePlot(chartDefinition);
    JFreeChartEngine.updatePlot(plot, chartDefinition);
    plot.setDataExtractOrder(order);

    JFreeChart pieCharts = new JFreeChart(title, chartDefinition.getTitleFont(), plot, legend);
    JFreeChart pieChart = plot.getPieChart();
    TextTitle seriesTitle = new TextTitle("Series Title", new Font("SansSerif", Font.BOLD, 12)); //$NON-NLS-1$ //$NON-NLS-2$
    seriesTitle.setPosition(RectangleEdge.BOTTOM);
    pieChart.setTitle(seriesTitle);
    pieChart.setBackgroundPaint(chartDefinition.getChartBackgroundPaint());
    plot.setPieChart(pieChart);

    // if (tooltips) {
    // PieToolTipGenerator tooltipGenerator = new
    // StandardPieToolTipGenerator();
    // PiePlot pp = (PiePlot) plot.getPieChart().getPlot();
    // pp.setToolTipGenerator(tooltipGenerator);
    // }

    // if (urls) {
    // PieURLGenerator urlGenerator = new StandardPieURLGenerator();
    // PiePlot pp = (PiePlot) plot.getPieChart().getPlot();
    // pp.setURLGenerator(urlGenerator);
    // }

    return pieCharts;
}

From source file:org.mwc.debrief.sensorfusion.views.SensorFusionView.java

/**
 * This is a callback that will allow us to create the viewer and initialize
 * it.//from   w w w  .  j a va 2s  . co m
 */
public void createPartControl(final Composite parent) {
    makeActions();
    contributeToActionBars();

    // and the selection provider bits
    _selectionHelper = new SelectionHelper();
    getSite().setSelectionProvider(_selectionHelper);

    // declare our context sensitive help
    CorePlugin.declareContextHelp(parent, "org.mwc.debrief.help.BulkSensorData");

    parent.setLayout(new FillLayout());

    // ok, let's mockup the UI
    final JFreeChart myChart = DataSupport.createChart(null);
    myChart.setTitle(CHART_NAME);
    myChart.getXYPlot().setRenderer(_plotRenderer);

    // and the chart frame
    _myChartFrame = new ChartComposite(parent, SWT.NONE, myChart, 400, 600, 300, 200, 1800, 1800, true, true,
            true, true, true, true) {

        @Override
        protected Menu createPopupMenu(boolean arg0, boolean arg1, boolean arg2, boolean arg3) {
            // prevent the JFreeChart menu from opening
            return null;
        }

        @Override
        public void mouseUp(MouseEvent event) {
            super.mouseUp(event);
            JFreeChart c = getChart();
            if (c != null) {
                c.setNotify(true); // force redraw
            }
        }
    };
    _myChartFrame.setDisplayToolTips(false);
    _myChartFrame.setHorizontalAxisTrace(false);
    _myChartFrame.setVerticalAxisTrace(false);

    _myChartFrame.addChartMouseListener(new ChartMouseListener() {

        public void chartMouseClicked(final ChartMouseEvent event) {
            final ChartEntity entity = event.getEntity();
            if (entity instanceof XYItemEntity) {
                final XYItemEntity xyi = (XYItemEntity) entity;
                final TimeSeriesCollection coll = (TimeSeriesCollection) xyi.getDataset();
                final TacticalSeries ts = (TacticalSeries) coll
                        .getSeries(((XYItemEntity) entity).getSeriesIndex());
                if (ts instanceof SensorSeries) {
                    final SensorSeries ss = (SensorSeries) ts;

                    // check which mouse it si
                    if (event.getTrigger().getButton() == 3) {
                        // get the sensor itself
                        final SensorWrapper sensor = ss.getSensor();

                        // get the parent layer
                        final TrackWrapper parentLayer = (TrackWrapper) _trackData.getPrimaryTrack();

                        // ok, create ourselves a menu
                        final MenuManager mmgr = new MenuManager();

                        // insert the relevant menu items
                        RightClickSupport.getDropdownListFor(mmgr, new Editable[] { sensor }, null,
                                new Layer[] { parentLayer }, _currentLayers, false);

                        // get the SWT menu object for it
                        final Menu thisM = mmgr.createContextMenu(_myChartFrame);

                        // and display it
                        thisM.setVisible(true);
                    } else {
                        // right, is ctrl-key pressed
                        final int mods = event.getTrigger().getModifiers();
                        if ((mods & InputEvent.CTRL_MASK) == 0) {
                            _selectedTracks.removeAllElements();
                            _selectedTracks.add(ss);
                        } else {
                            if (_selectedTracks.contains(ts))
                                _selectedTracks.remove(ts);
                            else
                                _selectedTracks.add(ss);

                        }

                        // and update the UI
                        updatedSelection();

                        // ok, we need to redraw
                        redrawPlot();
                    }
                }
            } else {
                _selectedTracks.removeAllElements();

                // and update the UI
                updatedSelection();
                // ok, we need to redraw
                redrawPlot();
            }
        }

        public void chartMouseMoved(final ChartMouseEvent event) {
        }
    });

    _selectionChangeListener = new ISelectionChangedListener() {

        @SuppressWarnings({ "rawtypes" })
        public void selectionChanged(final SelectionChangedEvent event) {
            // right, see what it is
            final ISelection sel = event.getSelection();
            if (sel instanceof StructuredSelection) {
                final StructuredSelection ss = (StructuredSelection) sel;
                final Iterator eles = ss.iterator();
                boolean processingThese = false;
                while (eles.hasNext()) {
                    final Object datum = eles.next();
                    if (datum instanceof EditableWrapper) {
                        final EditableWrapper pw = (EditableWrapper) datum;
                        final Editable ed = pw.getEditable();
                        if (ed instanceof SensorWrapper) {
                            if (!processingThese) {
                                processingThese = true;
                                _selectedTracks.removeAllElements();

                            }
                            final SensorSeries thisSeries = _trackIndex.get(ed);
                            _selectedTracks.add(thisSeries);
                        }
                    }
                }
                if (processingThese)
                    redrawPlot();
            }
        }
    };

    // and sort out the listeners
    setupListeners();

}

From source file:org.pentaho.platform.uifoundation.chart.JFreeChartEngine.java

private static JFreeChart createPieDatasetChart(final PieDatasetChartDefinition chartDefinition) {
    // TODO Make the following accessible from the chartDefinition
    boolean tooltips = true;
    boolean urls = true;
    // -----------------------------------------------------------

    String title = chartDefinition.getTitle();
    boolean legend = chartDefinition.isLegendIncluded();

    PiePlot plot = null;/*from   ww w  .  ja  va 2  s .c  om*/
    plot = chartDefinition.isThreeD() ? new PiePlot3D(chartDefinition) : new PiePlot(chartDefinition);
    JFreeChartEngine.updatePlot(plot, chartDefinition);
    JFreeChart pieChart = new JFreeChart(title, chartDefinition.getTitleFont(), plot, legend);
    TextTitle seriesTitle = new TextTitle("Series Title", new Font("SansSerif", Font.BOLD, 12)); //$NON-NLS-1$ //$NON-NLS-2$
    seriesTitle.setPosition(RectangleEdge.BOTTOM);
    pieChart.setTitle(title);
    pieChart.setBackgroundPaint(chartDefinition.getChartBackgroundPaint());

    if (tooltips) {
        PieToolTipGenerator tooltipGenerator = new StandardPieToolTipGenerator();
        plot.setToolTipGenerator(tooltipGenerator);
    }

    if (urls) {
        PieURLGenerator urlGenerator = new StandardPieURLGenerator();
        plot.setURLGenerator(urlGenerator);
    }

    return pieChart;
}

From source file:projects.wdlf47tuc.ProcessAllSwathcal.java

/**
 * Plots the CMD using the existing dataset. Used whenever chart annotations change, without the
 * underlying plot data changing. This method identifies all sources lying within the boxed region
 * and loads them into the secondary list {@link #boxedSources}.
 * //w  w  w . j av  a 2  s . c om
 * @param allSources
 *    The {@link Source}s to plot
 * @return
 *    A JFreeChart presenting the colour-magnitude diagram for the current selection criteria and colours.
 */
private JFreeChart plotCmd() {

    XYSeries outside = new XYSeries("Outside");
    XYSeries inside = new XYSeries("Inside");

    // Use a Path2D.Double instance to determine polygon intersection
    Path2D.Double path = new Path2D.Double();
    boxedSources.clear();

    boolean performBoxSelection = (points.size() > 2);

    if (performBoxSelection) {
        // Initialise Path2D object
        path.moveTo(points.get(0)[0], points.get(0)[1]);
        for (double[] point : points) {
            path.lineTo(point[0], point[1]);
        }
    }

    for (Source source : selectedSources) {
        double magnitude = source.getMag(magFilter);
        double col1 = source.getMag(col1Filter);
        double col2 = source.getMag(col2Filter);

        double x = col1 - col2;
        double y = magnitude;

        if (performBoxSelection) {
            Point2D.Double point = new Point2D.Double(x, y);
            if (path.contains(point)) {
                inside.add(x, y);
                boxedSources.add(source);
            } else {
                outside.add(x, y);
            }
        } else {
            outside.add(x, y);
        }
    }

    final XYSeriesCollection data = new XYSeriesCollection();
    data.addSeries(outside);
    data.addSeries(inside);

    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
    renderer.setSeriesLinesVisible(0, false);
    renderer.setSeriesShapesVisible(0, true);
    renderer.setSeriesShape(0, new Ellipse2D.Float(-0.5f, -0.5f, 1, 1));
    renderer.setSeriesPaint(0, ChartColor.BLACK);

    renderer.setSeriesLinesVisible(1, false);
    renderer.setSeriesShapesVisible(1, true);
    renderer.setSeriesShape(1, new Ellipse2D.Float(-0.5f, -0.5f, 1, 1));
    renderer.setSeriesPaint(1, ChartColor.RED);

    NumberAxis xAxis = new NumberAxis(col1Filter.toString() + " - " + col2Filter.toString());
    xAxis.setRange(getXRange());

    NumberAxis yAxis = new NumberAxis(magFilter.toString());
    yAxis.setRange(getYRange());
    yAxis.setInverted(true);

    // Configure plot
    XYPlot xyplot = new XYPlot(data, xAxis, yAxis, renderer);
    xyplot.setBackgroundPaint(Color.lightGray);
    xyplot.setDomainGridlinePaint(Color.white);
    xyplot.setDomainGridlinesVisible(true);
    xyplot.setRangeGridlinePaint(Color.white);

    // Specify selection box, if points have been specified
    if (!points.isEmpty()) {

        double[] coords = new double[points.size() * 2];

        for (int i = 0; i < points.size(); i++) {
            double[] point = points.get(i);
            coords[2 * i + 0] = point[0];
            coords[2 * i + 1] = point[1];
        }
        XYPolygonAnnotation box = new XYPolygonAnnotation(coords, new BasicStroke(2.0f), Color.BLUE);
        xyplot.addAnnotation(box);
    }

    // Configure chart
    JFreeChart chart = new JFreeChart("47 Tuc CMD", xyplot);
    chart.setBackgroundPaint(Color.white);
    chart.setTitle("47 Tuc colour-magnitude diagram");
    chart.removeLegend();

    return chart;
}

From source file:projects.wdlf47tuc.ProcessAllSwathcal.java

/**
 * Computes the luminosity function for the current boxed region and plots it in a JFrame.
 * Also prints out the coordinates of the selection box vertices and the luminosity function
 * quantities.//from   ww w  . j  a  v  a 2 s .  c  o m
 * 
 * @param sources
 *    The {@link Source}s to compute the luminosity function for.
 */
private void computeAndPlotLuminosityFunction(List<Source> sources) {

    // Print out coordinates of selection box corners
    System.out.println("# Coordinates of selection box corners:");
    System.out.println("# (" + col1Filter + "-" + col2Filter + ")\t" + magFilter);
    for (double[] point : points) {
        System.out.println("# " + point[0] + "\t" + point[1]);
    }
    System.out.println("# Luminosity function:");
    System.out.println("# Mag.\tN\tsigN");

    double magBinWidth = 0.5;

    // Get the range of the data
    double mMin = Double.MAX_VALUE;
    double mMax = -Double.MAX_VALUE;
    for (Source source : sources) {
        double mag = source.getMag(magFilter) - mu;
        mMin = Math.min(mMin, mag);
        mMax = Math.max(mMax, mag);
    }

    // Quantize this to a whole number
    mMin = Math.floor(mMin);
    mMax = Math.ceil(mMax);

    int nBins = (int) Math.rint((mMax - mMin) / magBinWidth);

    // Array to accumulate all objects in each bin
    int[] n = new int[nBins];

    for (Source source : sources) {
        double mag = source.getMag(magFilter) - mu;
        // Bin number
        int bin = (int) Math.floor((mag - mMin) / magBinWidth);
        n[bin]++;
    }

    YIntervalSeries luminosityFunction = new YIntervalSeries("Luminosity Function");

    for (int i = 0; i < nBins; i++) {
        // Bin centre
        double x = mMin + i * magBinWidth + 0.5 * magBinWidth;
        double y = n[i];
        double yErr = n[i] > 0 ? Math.sqrt(y) : 0;
        luminosityFunction.add(x, y, y - yErr, y + yErr);
        System.out.println(x + "\t" + y + "\t" + yErr);
    }

    final YIntervalSeriesCollection data = new YIntervalSeriesCollection();
    data.addSeries(luminosityFunction);

    XYErrorRenderer renderer = new XYErrorRenderer();
    renderer.setSeriesLinesVisible(0, true);
    renderer.setSeriesShapesVisible(0, true);
    renderer.setSeriesShape(0, new Ellipse2D.Float(-1f, -1f, 2, 2));
    renderer.setSeriesPaint(0, ChartColor.BLACK);

    NumberAxis xAxis = new NumberAxis("Absolute Magnitude (" + magFilter.toString() + ")");
    xAxis.setAutoRange(true);
    xAxis.setAutoRangeIncludesZero(false);

    NumberAxis yAxis = new NumberAxis("N");
    yAxis.setAutoRange(true);
    yAxis.setAutoRangeIncludesZero(true);

    // Configure plot
    XYPlot xyplot = new XYPlot(data, xAxis, yAxis, renderer);
    xyplot.setBackgroundPaint(Color.lightGray);
    xyplot.setDomainGridlinePaint(Color.white);
    xyplot.setDomainGridlinesVisible(true);
    xyplot.setRangeGridlinePaint(Color.white);

    // Configure chart
    JFreeChart chart = new JFreeChart("Luminosity Function", xyplot);
    chart.setBackgroundPaint(Color.white);
    chart.setTitle("47 Tuc luminosity function");
    chart.removeLegend();

    final ChartPanel lfChartPanel = new ChartPanel(chart);

    java.awt.EventQueue.invokeLater(new Runnable() {
        @Override
        public void run() {
            JFrame tester = new JFrame();
            tester.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
            tester.setLayout(new BorderLayout());
            tester.add(lfChartPanel, BorderLayout.CENTER);
            tester.pack();
            tester.setVisible(true);
        }
    });

}

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

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

    final JFreeChart chart = ChartFactory.createBarChart(null, // chart title
            null, // domain axis label
            null, // range axis label
            dataset, // data
            PlotOrientation.HORIZONTAL, // orientation
            false, // include legend
            true, false);

    chart.setBackgroundPaint(Color.white);

    final TextTitle title = new TextTitle("Figure 7 | I. Resources - The site offers users relevant, "
            + "informative and educational resources");
    title.setHorizontalAlignment(HorizontalAlignment.LEFT);
    title.setBackgroundPaint(Color.red);
    title.setPaint(Color.white);

    chart.setTitle(title);
    final CategoryPlot plot = (CategoryPlot) chart.getPlot();
    plot.setOutlinePaint(null);
    plot.setDomainGridlinesVisible(true);
    plot.setDomainGridlinePosition(CategoryAnchor.END);
    plot.setDomainGridlineStroke(new BasicStroke(0.5f));
    plot.setDomainGridlinePaint(Color.black);

    plot.setRangeGridlinesVisible(false);
    plot.clearRangeMarkers();

    final CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setVisible(false);
    domainAxis.setCategoryMargin(0.50);

    plot.getRangeAxis().setVisible(false);

    final CategoryItemRenderer renderer = plot.getRenderer();
    renderer.setSeriesPaint(0, new Color(0x9C, 0xA4, 0x4A));
    renderer.setOutlineStroke(null);
    renderer.setBaseOutlineStroke(null);

    renderer.setItemLabelsVisible(true);
    renderer.setItemLabelFont(new Font("SansSerif", Font.BOLD, 10));
    final ItemLabelPosition position = new ItemLabelPosition(ItemLabelAnchor.INSIDE3, TextAnchor.CENTER_RIGHT);
    renderer.setPositiveItemLabelPosition(position);

    final CategoryTextAnnotation a1 = new CategoryTextAnnotation("1. White papers are available.", "Category 1",
            0.0);
    a1.setFont(new Font("SansSerif", Font.BOLD, 12));
    a1.setTextAnchor(TextAnchor.BOTTOM_LEFT);
    a1.setCategoryAnchor(CategoryAnchor.START);
    plot.addAnnotation(a1);

    final CategoryTextAnnotation a2 = new CategoryTextAnnotation(
            "2. White papers enhance users " + "understanding of the firm and its expertise.", "Category 2",
            0.0);
    a2.setFont(new Font("SansSerif", Font.PLAIN, 12));
    a2.setTextAnchor(TextAnchor.BOTTOM_LEFT);
    a2.setCategoryAnchor(CategoryAnchor.START);
    plot.addAnnotation(a2);

    final CategoryTextAnnotation a3 = new CategoryTextAnnotation(
            "3. White papers are relevant to " + "the firm's prospects and clients.", "Category 3", 0.0);
    a3.setFont(new Font("SansSerif", Font.PLAIN, 12));
    a3.setTextAnchor(TextAnchor.BOTTOM_LEFT);
    a3.setCategoryAnchor(CategoryAnchor.START);
    plot.addAnnotation(a3);

    final CategoryTextAnnotation a4 = new CategoryTextAnnotation(
            "4. White papers are relevant to " + "the firm's positioning.", "Category 4", 0.0);
    a4.setFont(new Font("SansSerif", Font.PLAIN, 12));
    a4.setTextAnchor(TextAnchor.BOTTOM_LEFT);
    a4.setCategoryAnchor(CategoryAnchor.START);
    plot.addAnnotation(a4);

    final CategoryTextAnnotation a5 = new CategoryTextAnnotation("5. Case studies are available.", "Category 5",
            0.0);
    a5.setFont(new Font("SansSerif", Font.BOLD, 12));
    a5.setTextAnchor(TextAnchor.BOTTOM_LEFT);
    a5.setCategoryAnchor(CategoryAnchor.START);
    plot.addAnnotation(a5);

    final CategoryTextAnnotation a6 = new CategoryTextAnnotation(
            "6. Case studies enhance users " + "understanding of the firm and its expertise.", "Category 6",
            0.0);
    a6.setFont(new Font("SansSerif", Font.PLAIN, 12));
    a6.setTextAnchor(TextAnchor.BOTTOM_LEFT);
    a6.setCategoryAnchor(CategoryAnchor.START);
    plot.addAnnotation(a6);

    final CategoryTextAnnotation a7 = new CategoryTextAnnotation(
            "7. Case studies are relevant to " + "the firm's prospects and clients.", "Category 7", 0.0);
    a7.setFont(new Font("SansSerif", Font.PLAIN, 12));
    a7.setTextAnchor(TextAnchor.BOTTOM_LEFT);
    a7.setCategoryAnchor(CategoryAnchor.START);
    plot.addAnnotation(a7);

    final CategoryTextAnnotation a8 = new CategoryTextAnnotation(
            "8. White papers are relevant to the firm's positioning.", "Category 8", 0.0);
    a8.setFont(new Font("SansSerif", Font.PLAIN, 12));
    a8.setTextAnchor(TextAnchor.BOTTOM_LEFT);
    a8.setCategoryAnchor(CategoryAnchor.START);
    plot.addAnnotation(a8);

    final CategoryTextAnnotation a9 = new CategoryTextAnnotation("9. Case studies are available.", "Category 9",
            0.0);
    a9.setFont(new Font("SansSerif", Font.BOLD, 12));
    a9.setTextAnchor(TextAnchor.BOTTOM_LEFT);
    a9.setCategoryAnchor(CategoryAnchor.START);
    plot.addAnnotation(a9);

    final CategoryTextAnnotation a10 = new CategoryTextAnnotation(
            "10. Case studies enhance users " + "understanding of the firm and its expertise.", "Category 10",
            0.0);
    a10.setFont(new Font("SansSerif", Font.PLAIN, 12));
    a10.setTextAnchor(TextAnchor.BOTTOM_LEFT);
    a10.setCategoryAnchor(CategoryAnchor.START);
    plot.addAnnotation(a10);

    final CategoryTextAnnotation a11 = new CategoryTextAnnotation(
            "11. Case studies are relevant " + "to the firm's prospects and clients.", "Category 11", 0.0);
    a11.setFont(new Font("SansSerif", Font.PLAIN, 12));
    a11.setTextAnchor(TextAnchor.BOTTOM_LEFT);
    a11.setCategoryAnchor(CategoryAnchor.START);
    plot.addAnnotation(a11);

    final CategoryTextAnnotation a12 = new CategoryTextAnnotation(
            "12. White papers are relevant to the firm's positioning.", "Category 12", 0.0);
    a12.setFont(new Font("SansSerif", Font.PLAIN, 12));
    a12.setTextAnchor(TextAnchor.BOTTOM_LEFT);
    a12.setCategoryAnchor(CategoryAnchor.START);
    plot.addAnnotation(a12);

    final CategoryTextAnnotation a13 = new CategoryTextAnnotation(
            "13. Users can easily access " + "resources based on viewer interest.", "Category 13", 0.0);
    a13.setFont(new Font("SansSerif", Font.BOLD, 12));
    a13.setTextAnchor(TextAnchor.BOTTOM_LEFT);
    a13.setCategoryAnchor(CategoryAnchor.START);
    plot.addAnnotation(a13);

    final CategoryTextAnnotation a14 = new CategoryTextAnnotation(
            "14. Access to additional hyperlinks enhances users's ability to find relevant " + "information.",
            "Category 14", 0.0);
    a14.setFont(new Font("SansSerif", Font.BOLD, 12));
    a14.setTextAnchor(TextAnchor.BOTTOM_LEFT);
    a14.setCategoryAnchor(CategoryAnchor.START);
    plot.addAnnotation(a14);

    final CategoryTextAnnotation a15 = new CategoryTextAnnotation("15. OVERALL EFFECTIVENESS.", "Overall", 0.0);
    a15.setFont(new Font("SansSerif", Font.BOLD, 12));
    a15.setTextAnchor(TextAnchor.BOTTOM_LEFT);
    a15.setCategoryAnchor(CategoryAnchor.START);
    plot.addAnnotation(a15);

    return chart;

}