Example usage for org.jfree.chart JFreeChart DEFAULT_TITLE_FONT

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

Introduction

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

Prototype

Font DEFAULT_TITLE_FONT

To view the source code for org.jfree.chart JFreeChart DEFAULT_TITLE_FONT.

Click Source Link

Document

The default font for titles.

Usage

From source file:diplomawork.controler.MainWindow.java

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    JFreeChart chart = null;/*  w  w w .  j a  v a2 s. c om*/
    try {
        Plot plot = (Plot) viewForDiagram.getChartPanel().getChart().getPlot().clone();
        chart = new JFreeChart(null, JFreeChart.DEFAULT_TITLE_FONT, plot, false);
    } catch (CloneNotSupportedException ex) {
        Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);
    }
    jPEGSaver.saveChartToFile(chart, true);

}

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

/**
 * Creates a combined XYPlot chart./*from  w  w w  . j a v a2  s . c  o  m*/
 *
 * @return the combined chart.
 */
private JFreeChart createCombinedChart() {

    // create a default chart based on some sample data...
    final TimeSeriesCollection dataset0 = new TimeSeriesCollection();
    final TimeSeries eur = DemoDatasetFactory.createEURTimeSeries();
    dataset0.addSeries(eur);

    final TimeSeriesCollection dataset1 = new TimeSeriesCollection();
    final TimeSeries mav = MovingAverage.createMovingAverage(eur, "EUR/GBP (30 Day MA)", 30, 30);
    dataset1.addSeries(eur);
    dataset1.addSeries(mav);

    final TimeSeriesCollection dataset2 = new TimeSeriesCollection();
    dataset2.addSeries(eur);

    JFreeChart chart = null;

    // make a common vertical axis for all the sub-plots
    final NumberAxis valueAxis = new NumberAxis("Value");
    valueAxis.setAutoRangeIncludesZero(false); // override default

    // make a horizontally combined plot
    final CombinedRangeXYPlot parent = new CombinedRangeXYPlot(valueAxis);

    // add subplot 1...
    final XYPlot subplot1 = new XYPlot(dataset0, new DateAxis("Date 1"), null, new StandardXYItemRenderer());
    subplot1.setDomainCrosshairVisible(true);
    subplot1.setRangeCrosshairVisible(true);
    parent.add(subplot1, 1);

    // add subplot 2...
    final XYPlot subplot2 = new XYPlot(dataset1, new DateAxis("Date 2"), null, new StandardXYItemRenderer());
    subplot2.setDomainCrosshairVisible(true);
    subplot2.setRangeCrosshairVisible(true);
    parent.add(subplot2, 1);

    // add subplot 3...
    final XYPlot subplot3 = new XYPlot(dataset2, new DateAxis("Date 3"), null, new XYBarRenderer(0.20));
    subplot3.setDomainCrosshairVisible(true);
    subplot3.setRangeCrosshairVisible(true);
    parent.add(subplot3, 1);

    // now make the top level JFreeChart
    chart = new JFreeChart("Demo Chart", JFreeChart.DEFAULT_TITLE_FONT, parent, true);

    // then customise it a little...
    final TextTitle subtitle = new TextTitle("This is a subtitle", new Font("SansSerif", Font.BOLD, 12));
    chart.addSubtitle(subtitle);
    chart.setBackgroundPaint(new GradientPaint(0, 0, Color.white, 0, 1000, Color.blue));
    return chart;

}

From source file:ecosim.gui.SummaryPane.java

/**
 *  Private method to build the binning chart.
 *
 *  @return A ChartPanel containing the binning chart.
 *///  w w w. j av  a  2 s  .c o m
private ChartPanel makeBinningChart() {
    final DefaultXYDataset binData = new DefaultXYDataset();
    final NumberFormat nf = NumberFormat.getInstance();
    final NumberAxis xAxis = new NumberAxis("Sequence identity criterion");
    nf.setMinimumFractionDigits(2);
    xAxis.setLowerBound(Binning.binLevels[0]);
    xAxis.setUpperBound(1.0D);
    xAxis.setTickUnit(new NumberTickUnit(0.05D, nf));
    LogAxis yAxis = new LogAxis("Number of bins");
    yAxis.setBase(2.0D);
    yAxis.setNumberFormatOverride(NumberFormat.getInstance());
    yAxis.setTickUnit(new NumberTickUnit(2.0D));
    yAxis.setMinorTickMarksVisible(true);
    yAxis.setAutoRangeMinimumSize(4.0D);
    yAxis.setSmallestValue(1.0D);
    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true, false);
    for (int i = 0; i < seriesColors.length; i++) {
        renderer.setSeriesPaint(i, seriesColors[i]);
        renderer.setSeriesStroke(i, new BasicStroke(seriesStroke[i]));
    }
    XYPlot plot = new XYPlot(binData, xAxis, yAxis, renderer);
    JFreeChart binChart = new JFreeChart(null, JFreeChart.DEFAULT_TITLE_FONT, plot, false);
    binChart.setPadding(new RectangleInsets(0.0D, 0.0D, 0.0D, 10.0D));
    LegendTitle legend = new LegendTitle(plot);
    legend.setMargin(new RectangleInsets(1.0D, 1.0D, 1.0D, 1.0D));
    legend.setFrame(new LineBorder());
    legend.setBackgroundPaint(Color.white);
    legend.setPosition(RectangleEdge.BOTTOM);
    plot.addAnnotation(new XYTitleAnnotation(0.001D, 0.999D, legend, RectangleAnchor.TOP_LEFT));
    final ChartPanel pane = new ChartPanel(binChart, false, true, true, false, false);
    // Watch for changes to the Summary object.
    summary.addObserver(new Observer() {
        public void update(Observable o, Object obj) {
            Summary s = (Summary) obj;
            ParameterEstimate estimate = s.getEstimate();
            ArrayList<BinLevel> bins = s.getBins();
            if (bins.size() > 0) {
                double[][] values = new double[2][bins.size()];
                Double low = 1.0d;
                for (int i = 0; i < bins.size(); i++) {
                    BinLevel bin = bins.get(i);
                    values[0][i] = bin.getCrit();
                    values[1][i] = bin.getLevel();
                    if (values[0][i] < low)
                        low = values[0][i];
                }
                binData.addSeries("sequences", values);
                xAxis.setLowerBound(low);
                if (low > 0.95d - MasterVariables.EPSILON) {
                    xAxis.setTickUnit(new NumberTickUnit(0.005D, nf));
                } else if (low > 0.90d - MasterVariables.EPSILON) {
                    xAxis.setTickUnit(new NumberTickUnit(0.010D, nf));
                } else if (low > 0.80d - MasterVariables.EPSILON) {
                    xAxis.setTickUnit(new NumberTickUnit(0.025D, nf));
                }
                if (estimate != null) {
                    double[][] omega = new double[2][bins.size()];
                    double[][] sigma = new double[2][bins.size()];
                    double[] omegaLine = estimate.getOmega();
                    double[] sigmaLine = estimate.getSigma();
                    for (int i = 0; i < bins.size(); i++) {
                        double crit = 1.0D - values[0][i];
                        double snp = s.getLength() * crit;
                        omega[0][i] = values[0][i];
                        sigma[0][i] = values[0][i];
                        omega[1][i] = Math.pow(2.0D, snp * omegaLine[0] + omegaLine[1]);
                        sigma[1][i] = Math.pow(2.0D, snp * sigmaLine[0] + sigmaLine[1]);
                    }
                    if (-1.0D * omegaLine[0] > MasterVariables.EPSILON) {
                        binData.addSeries("omega", omega);
                    }
                    if (-1.0D * sigmaLine[0] > MasterVariables.EPSILON) {
                        binData.addSeries("sigma", sigma);
                    }
                }
                // Repaint the summary pane.
                pane.repaint();
            }
        }
    });
    return pane;
}

From source file:playground.dgrether.analysis.charts.DgModalSplitGroupChart.java

public JFreeChart createChart() {
    CategoryAxis categoryAxis = this.axisBuilder.createCategoryAxis(xLabel);
    categoryAxis.setCategoryLabelPositions(CategoryLabelPositions.DOWN_45);
    ValueAxis valueAxis = this.axisBuilder.createValueAxis(yLabel);
    valueAxis.setRange(0.0, 100.0);//from  w  ww .j a  va 2 s  .c o m

    DgColorScheme colorScheme = new DgColorScheme();

    CategoryPlot plot = new CategoryPlot();
    plot.setDomainAxis(categoryAxis);
    plot.setRangeAxis(valueAxis);
    plot.setDataset(0, this.dataset);
    BarRenderer carRenderer = new BarRenderer();
    carRenderer.setSeriesPaint(0, colorScheme.COLOR1A);
    carRenderer.setSeriesPaint(1, colorScheme.COLOR3A);

    carRenderer.setItemMargin(0.10);
    plot.setRenderer(0, carRenderer);

    JFreeChart chart = new JFreeChart("", JFreeChart.DEFAULT_TITLE_FONT, plot, true);
    chart.setBackgroundPaint(ChartColor.WHITE);
    chart.getLegend().setItemFont(this.axisBuilder.getAxisFont());
    return chart;
}

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

public static JPanel createDemoPanel() {
    TimeSeries timeseries = new TimeSeries("Annual");
    timeseries.add(new Year(1998), 80D);
    timeseries.add(new Year(1999), 85D);
    timeseries.add(new Year(2000), 87.599999999999994D);
    TimeSeriesCollection dataset1 = new TimeSeriesCollection(timeseries);
    TimeSeries timeseries1 = new TimeSeries("Monthly A");
    timeseries1.add(new Month(7, 2000), 85.799999999999997D);
    timeseries1.add(new Month(8, 2000), 85.799999999999997D);
    timeseries1.add(new Month(9, 2000), 85.799999999999997D);
    timeseries1.add(new Month(10, 2000), 86.5D);
    timeseries1.add(new Month(11, 2000), 86.5D);
    timeseries1.add(new Month(12, 2000), 86.5D);
    timeseries1.add(new Month(1, 2001), 87.700000000000003D);
    timeseries1.add(new Month(2, 2001), 87.700000000000003D);
    timeseries1.add(new Month(3, 2001), 87.700000000000003D);
    timeseries1.add(new Month(4, 2001), 88.5D);
    timeseries1.add(new Month(5, 2001), 88.5D);
    timeseries1.add(new Month(6, 2001), 88.5D);
    timeseries1.add(new Month(7, 2001), 90D);
    timeseries1.add(new Month(8, 2001), 90D);
    timeseries1.add(new Month(9, 2001), 90D);
    timeseries1.add(new Month(10, 2001), 90D);
    timeseries1.add(new Month(11, 2001), 90D);
    timeseries1.add(new Month(12, 2001), 90D);
    timeseries1.add(new Month(1, 2002), 90D);
    timeseries1.add(new Month(2, 2002), 90D);
    timeseries1.add(new Month(3, 2002), 90D);
    timeseries1.add(new Month(4, 2002), 90D);
    timeseries1.add(new Month(5, 2002), 90D);
    timeseries1.add(new Month(6, 2002), 90D);
    TimeSeries timeseries2 = new TimeSeries("Monthly B");
    timeseries2.add(new Month(7, 2000), 83.799999999999997D);
    timeseries2.add(new Month(8, 2000), 83.799999999999997D);
    timeseries2.add(new Month(9, 2000), 83.799999999999997D);
    timeseries2.add(new Month(10, 2000), 84.5D);
    timeseries2.add(new Month(11, 2000), 84.5D);
    timeseries2.add(new Month(12, 2000), 84.5D);
    timeseries2.add(new Month(1, 2001), 85.700000000000003D);
    timeseries2.add(new Month(2, 2001), 85.700000000000003D);
    timeseries2.add(new Month(3, 2001), 85.700000000000003D);
    timeseries2.add(new Month(4, 2001), 86.5D);
    timeseries2.add(new Month(5, 2001), 86.5D);
    timeseries2.add(new Month(6, 2001), 86.5D);
    timeseries2.add(new Month(7, 2001), 88D);
    timeseries2.add(new Month(8, 2001), 88D);
    timeseries2.add(new Month(9, 2001), 88D);
    timeseries2.add(new Month(10, 2001), 88D);
    timeseries2.add(new Month(11, 2001), 88D);
    timeseries2.add(new Month(12, 2001), 88D);
    timeseries2.add(new Month(1, 2002), 88D);
    timeseries2.add(new Month(2, 2002), 88D);
    timeseries2.add(new Month(3, 2002), 88D);
    timeseries2.add(new Month(4, 2002), 88D);
    timeseries2.add(new Month(5, 2002), 88D);
    timeseries2.add(new Month(6, 2002), 88D);
    TimeSeriesCollection dataset21 = new TimeSeriesCollection();
    dataset21.addSeries(timeseries1);/*from w ww  . j  a v a 2 s .c o m*/
    dataset21.addSeries(timeseries2);
    TimeSeries timeseries3 = new TimeSeries("XXX");
    timeseries3.add(new Month(7, 2000), 81.5D);
    timeseries3.add(new Month(8, 2000), 86D);
    timeseries3.add(new Month(9, 2000), 82D);
    timeseries3.add(new Month(10, 2000), 89.5D);
    timeseries3.add(new Month(11, 2000), 88D);
    timeseries3.add(new Month(12, 2000), 88D);
    timeseries3.add(new Month(1, 2001), 90D);
    timeseries3.add(new Month(2, 2001), 89.5D);
    timeseries3.add(new Month(3, 2001), 90.200000000000003D);
    timeseries3.add(new Month(4, 2001), 90.599999999999994D);
    timeseries3.add(new Month(5, 2001), 87.5D);
    timeseries3.add(new Month(6, 2001), 91D);
    timeseries3.add(new Month(7, 2001), 89.700000000000003D);
    timeseries3.add(new Month(8, 2001), 87D);
    timeseries3.add(new Month(9, 2001), 91.200000000000003D);
    timeseries3.add(new Month(10, 2001), 84D);
    timeseries3.add(new Month(11, 2001), 90D);
    timeseries3.add(new Month(12, 2001), 92D);
    TimeSeriesCollection dataset22 = new TimeSeriesCollection(timeseries3);
    //
    XYBarRenderer renderer1 = new XYBarRenderer(0.20000000000000001D);
    renderer1.setBaseToolTipGenerator(new StandardXYToolTipGenerator("{0} ({1}, {2})",
            new SimpleDateFormat("yyyy"), new DecimalFormat("0.00")));
    XYPlot plot1 = new XYPlot(dataset1, new DateAxis("Date"), null, renderer1);
    //
    XYAreaRenderer renderer21 = new XYAreaRenderer();
    XYPlot plot2 = new XYPlot(dataset21, new DateAxis("Date"), null, renderer21);
    StandardXYItemRenderer renderer22 = new StandardXYItemRenderer(3);
    renderer22.setBaseShapesFilled(true);
    plot2.setDataset(1, dataset22);
    plot2.setRenderer(1, renderer22);
    plot2.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);
    //
    NumberAxis valueAxis = new NumberAxis("Value");
    valueAxis.setAutoRangeIncludesZero(false);
    CombinedRangeXYPlot combinedPlot = new CombinedRangeXYPlot(valueAxis);
    combinedPlot.add(plot1, 1);
    combinedPlot.add(plot2, 4);
    //chart
    JFreeChart jfreechart = new JFreeChart("Sample Combined Plot", JFreeChart.DEFAULT_TITLE_FONT, combinedPlot,
            true);
    ChartPanel chartpanel = new ChartPanel(jfreechart);
    chartpanel.setPreferredSize(new Dimension(500, 270));
    chartpanel.addChartMouseListener(new ChartMouseListener() {

        public void chartMouseClicked(ChartMouseEvent chartmouseevent) {
            System.out.println(chartmouseevent.getEntity());
        }

        public void chartMouseMoved(ChartMouseEvent chartmouseevent) {
            System.out.println(chartmouseevent.getEntity());
        }

    });
    return chartpanel;
}

From source file:com.projity.pm.graphic.chart.ChartHelper.java

public static JFreeChart createLineChart(final XYDataset dataset) {
    NumberAxis xAxis = new NumberAxis(null);
    xAxis.setAutoRangeIncludesZero(false);
    NumberAxis yAxis = new NumberAxis(null);
    XYItemRenderer renderer = new StandardXYItemRenderer(StandardXYItemRenderer.LINES);
    XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer);
    plot.setOrientation(PlotOrientation.VERTICAL);
    renderer.setToolTipGenerator(new StandardXYToolTipGenerator());
    JFreeChart chart = new JFreeChart(null, JFreeChart.DEFAULT_TITLE_FONT, plot, false);
    removeAxisAndInsets(chart);/*w  ww. j a  v a 2s .c  o m*/
    return chart;
}

From source file:Presentation.MainWindow.java

/** Ajout  la fentre des graphiques de temprature et d'humidit en temps rel */
public void initGraphs() {
    XYSeriesCollection datasetT = new XYSeriesCollection();
    XYSeriesCollection datasetH = new XYSeriesCollection();

    datasetT.addSeries(seriesT);/*from  w  w  w .  ja v a  2s. c  o m*/
    datasetH.addSeries(seriesH);

    XYPlot plotT = new XYPlot(datasetT, new NumberAxis(), new NumberAxis(), new DefaultXYItemRenderer());
    XYPlot plotH = new XYPlot(datasetH, new NumberAxis(), new NumberAxis(), new DefaultXYItemRenderer());

    //plot.setDataset(1, datasetT);
    // plot.setRenderer(1, new DefaultXYItemRenderer());
    plotH.getRenderer().setSeriesPaint(0, Color.BLUE);
    JFreeChart chartT = new JFreeChart("Graphique de temprature", JFreeChart.DEFAULT_TITLE_FONT, plotT, true);
    JFreeChart chartH = new JFreeChart("Graphique d'humidit", JFreeChart.DEFAULT_TITLE_FONT, plotH, true);

    ChartPanel gPanelT = new ChartPanel(chartT);
    ChartPanel gPanelH = new ChartPanel(chartH);

    mPanel.add(gPanelT);
    mPanel.add(gPanelH);
}

From source file:ascensionxyplot.AscensionXYPlot.java

/**
 * Creates a combined chart.//from  w ww . j  a va  2s .  co m
 *
 * @return The combined chart.
 */
private JFreeChart createCombinedChart(File dataFile) {

    // create subplot 1...
    final XYDataset data1 = createDataset1(dataFile);
    final XYItemRenderer renderer1 = new StandardXYItemRenderer();
    final NumberAxis rangeAxis1 = new NumberAxis("Range 1");
    final XYPlot subplot1 = new XYPlot(data1, null, rangeAxis1, renderer1);
    subplot1.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);

    // add secondary axis
    //        subplot1.setDataset(1, createDataset2());
    //        final NumberAxis axis2 = new NumberAxis("Range Axis 2");
    //        axis2.setAutoRangeIncludesZero(false);
    //        subplot1.setRangeAxis(1, axis2);
    //        subplot1.setRangeAxisLocation(1, AxisLocation.BOTTOM_OR_RIGHT);
    //        subplot1.setRenderer(1, new StandardXYItemRenderer());       
    //        subplot1.mapDatasetToRangeAxis(1, 1);

    final XYTextAnnotation annotation1 = new XYTextAnnotation("x value", 20.0, 120000.0);
    final XYTextAnnotation annotation2 = new XYTextAnnotation("y value", 20.0, 110000.0);
    final XYTextAnnotation annotation3 = new XYTextAnnotation("z value", 20.0, 100000.0);
    final XYTextAnnotation annotation4 = new XYTextAnnotation("timepoint", 20.0, 10000.0);
    annotation1.setFont(new Font("SansSerif", Font.PLAIN, 9));
    annotation2.setFont(new Font("SansSerif", Font.PLAIN, 9));
    annotation3.setFont(new Font("SansSerif", Font.PLAIN, 9));
    annotation4.setFont(new Font("SansSerif", Font.PLAIN, 9));
    //        annotation.setRotationAngle(Math.PI / 4.0);
    subplot1.addAnnotation(annotation1);
    subplot1.addAnnotation(annotation2);
    subplot1.addAnnotation(annotation3);
    subplot1.addAnnotation(annotation4);

    // create subplot 2...
    final XYDataset data2 = createDataset2();
    final XYItemRenderer renderer2 = new StandardXYItemRenderer();
    final NumberAxis rangeAxis2 = new NumberAxis("Range 2");
    rangeAxis2.setAutoRangeIncludesZero(false);
    final XYPlot subplot2 = new XYPlot(data2, null, rangeAxis2, renderer2);
    subplot2.setRangeAxisLocation(AxisLocation.TOP_OR_LEFT);

    // parent plot...
    final CombinedDomainXYPlot plot = new CombinedDomainXYPlot(new NumberAxis("Domain"));
    plot.setGap(10.0);

    // add the subplots...
    plot.add(subplot1, 1);
    plot.add(subplot2, 1);
    plot.setOrientation(PlotOrientation.VERTICAL);

    // return a new chart containing the overlaid plot...
    return new JFreeChart("Is this the title?", JFreeChart.DEFAULT_TITLE_FONT, plot, true);

}

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

/**
 * Creates a stacked XY area plot.  The chart object returned by this method uses an {@link
 * org.jfree.chart.plot.XYPlot} instance as the plot, with a {@link org.jfree.chart.axis.NumberAxis} for the domain
 * axis, a {@link org.jfree.chart.axis.NumberAxis} as the range axis, and a {@link
 * org.jfree.chart.renderer.xy.StackedXYAreaRenderer2} as the renderer.
 *
 * @param title       the chart title (<code>null</code> permitted).
 * @param xAxisLabel  a label for the X-axis (<code>null</code> permitted).
 * @param yAxisLabel  a label for the Y-axis (<code>null</code> permitted).
 * @param dataset     the dataset for the chart (<code>null</code> permitted).
 * @param orientation the plot orientation (horizontal or vertical) (<code>null</code> NOT permitted).
 * @param legend      a flag specifying whether or not a legend is required.
 * @param tooltips    configure chart to generate tool tips?
 * @param urls        configure chart to generate URLs?
 * @return A stacked XY area chart.//from ww w  .j  a  v  a  2 s .  c  om
 */
protected static JFreeChart createStackedXYAreaChart(final String title, final String xAxisLabel,
        final String yAxisLabel, final XYDataset dataset, final PlotOrientation orientation,
        final boolean legend, final boolean tooltips, final boolean urls) {

    if (orientation == null) {
        throw new IllegalArgumentException("Null 'orientation' argument.");
    }
    final NumberAxis xAxis = new NumberAxis(xAxisLabel);
    xAxis.setAutoRangeIncludesZero(false);
    xAxis.setLowerMargin(0.0);
    xAxis.setUpperMargin(0.0);
    final NumberAxis yAxis = new NumberAxis(yAxisLabel);
    XYToolTipGenerator toolTipGenerator = null;
    if (tooltips) {
        toolTipGenerator = new StandardXYToolTipGenerator();
    }

    XYURLGenerator urlGenerator = null;
    if (urls) {
        urlGenerator = new StandardXYURLGenerator();
    }
    final StackedXYAreaRenderer2 renderer = new StackedXYAreaRenderer2(toolTipGenerator, urlGenerator);
    renderer.setOutline(true);
    final XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer);
    plot.setOrientation(orientation);

    plot.setRangeAxis(yAxis); // forces recalculation of the axis range

    return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
}

From source file:playground.dgrether.analysis.charts.DgModalSplitDiffQuantilesChart.java

public JFreeChart createChart() {
    CategoryAxis categoryAxis = this.axisBuilder.createCategoryAxis(xLabel);
    categoryAxis.setCategoryLabelPositions(CategoryLabelPositions.DOWN_45);
    ValueAxis valueAxis = this.axisBuilder.createValueAxis(yLabel);
    //RANGE/* www  . ja v  a 2 s  .c  o m*/
    //      valueAxis.setRange(-50.0, 50.0); //test
    valueAxis.setRange(-20.0, 20.0); //zh
    DgColorScheme colorScheme = new DgColorScheme();

    CategoryPlot plot = new CategoryPlot();
    plot.setDomainAxis(categoryAxis);
    //      plot.setDomainAxisLocation(AxisLocation.TOP_OR_RIGHT);
    plot.setRangeAxis(valueAxis);
    plot.setDataset(0, this.dataset);
    //      plot.setDomainGridlinePosition(CategoryAnchor.END);
    //      plot.setDomainGridlinesVisible(true);
    BarRenderer carRenderer = new BarRenderer();
    carRenderer.setSeriesPaint(0, colorScheme.COLOR1A);
    carRenderer.setSeriesPaint(1, colorScheme.COLOR3A);
    carRenderer.setSeriesItemLabelGenerator(0, this.labelgenerator);
    carRenderer.setSeriesItemLabelGenerator(1, this.labelgenerator);
    Font labelFont = new Font("Helvetica", Font.BOLD, 14);
    carRenderer.setSeriesItemLabelFont(0, labelFont);
    carRenderer.setSeriesItemLabelFont(1, labelFont);
    carRenderer.setSeriesItemLabelsVisible(0, true);
    carRenderer.setSeriesItemLabelsVisible(1, true);

    carRenderer.setItemMargin(0.15);
    plot.setRenderer(0, carRenderer);

    JFreeChart chart = new JFreeChart("", JFreeChart.DEFAULT_TITLE_FONT, plot, true);
    chart.setBackgroundPaint(ChartColor.WHITE);
    chart.removeLegend();
    //      chart.getLegend().setItemFont(this.axisBuilder.getAxisFont());
    return chart;
}