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:edu.dlnu.liuwenpeng.ChartFactory.ChartFactory.java

/**    
 * Creates and returns a default instance of a high-low-open-close chart.    
 *    //from w  ww. j  ava 2  s. c om
 * @param title  the chart title (<code>null</code> permitted).    
 * @param timeAxisLabel  a label for the time axis (<code>null</code>     
 *                       permitted).    
 * @param valueAxisLabel  a label for the value axis (<code>null</code>     
 *                        permitted).    
 * @param dataset  the dataset for the chart (<code>null</code> permitted).    
 * @param legend  a flag specifying whether or not a legend is required.    
 *    
 * @return A high-low-open-close chart.    
 */
public static JFreeChart createHighLowChart(String title, String timeAxisLabel, String valueAxisLabel,
        OHLCDataset dataset, boolean legend) {

    ValueAxis timeAxis = new DateAxis(timeAxisLabel);
    NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
    HighLowRenderer renderer = new HighLowRenderer();
    renderer.setBaseToolTipGenerator(new HighLowItemLabelGenerator());
    XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, renderer);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    return chart;

}

From source file:KIDLYFactory.java

/**
 * Creates and returns a default instance of a high-low-open-close chart.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param timeAxisLabel  a label for the time axis (<code>null</code>
 *                       permitted)./*  w  w w.jav a  2  s  .  com*/
 * @param valueAxisLabel  a label for the value axis (<code>null</code>
 *                        permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 *
 * @return A high-low-open-close chart.
 */
public static JFreeChart createHighLowChart(String title, String timeAxisLabel, String valueAxisLabel,
        OHLCDataset dataset, boolean legend) {

    ValueAxis timeAxis = new DateAxis(timeAxisLabel);
    NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
    HighLowRenderer renderer = new HighLowRenderer();
    renderer.setBaseToolTipGenerator(new HighLowItemLabelGenerator());
    XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, renderer);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    currentTheme.apply(chart);
    return chart;

}

From source file:edu.dlnu.liuwenpeng.ChartFactory.ChartFactory.java

/**    
 * Creates and returns a default instance of a high-low-open-close chart     
 * with a special timeline. This timeline can be a     
 * {@link org.jfree.chart.axis.SegmentedTimeline} such as the Monday     
 * through Friday timeline that will remove Saturdays and Sundays from    
 * the axis.    /*from  w w w . j a va2  s .c o m*/
 *    
 * @param title  the chart title (<code>null</code> permitted).    
 * @param timeAxisLabel  a label for the time axis (<code>null</code>     
 *                       permitted).    
 * @param valueAxisLabel  a label for the value axis (<code>null</code>     
 *                        permitted).    
 * @param dataset  the dataset for the chart (<code>null</code> permitted).    
 * @param timeline  the timeline.    
 * @param legend  a flag specifying whether or not a legend is required.    
 *    
 * @return A high-low-open-close chart.    
 */
public static JFreeChart createHighLowChart(String title, String timeAxisLabel, String valueAxisLabel,
        OHLCDataset dataset, Timeline timeline, boolean legend) {

    DateAxis timeAxis = new DateAxis(timeAxisLabel);
    timeAxis.setTimeline(timeline);
    NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
    HighLowRenderer renderer = new HighLowRenderer();
    renderer.setBaseToolTipGenerator(new HighLowItemLabelGenerator());
    XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, renderer);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    return chart;

}

From source file:hpssim.grafica.HPSsim.java

private void setMeter() {
    datasetCPU = new DefaultValueDataset(0D);
    JFreeChart jfreechartCPU = createChart(datasetCPU, "CPU Usage");

    datasetGPU = new DefaultValueDataset(0D);
    JFreeChart jfreechartGPU = createChart(datasetGPU, "GPU Usage");

    panelCPU.add("Center", new ChartPanel(jfreechartCPU));
    panelCPU.add("South", new Label(""));

    panelGPU.add("Center", new ChartPanel(jfreechartGPU));
    panelGPU.add("South", new Label(""));

    datasetQueueCPU = new DefaultValueDataset(0D);
    datasetQueueGPU = new DefaultValueDataset(0D);

    ThermometerPlot gpuThermometerQueue = new ThermometerPlot(datasetQueueGPU);
    gpuThermometerQueue.setRange(0, 50);

    gpuThermometerQueue.setSubrange(ThermometerPlot.NORMAL, 0.0, 10.0);
    gpuThermometerQueue.setSubrange(ThermometerPlot.WARNING, 10.0, 25.0);
    gpuThermometerQueue.setSubrange(ThermometerPlot.CRITICAL, 25.0, 5000.0);
    gpuThermometerQueue.setUnits(ThermometerPlot.UNITS_NONE);
    gpuThermometerQueue.setBulbRadius(22);
    gpuThermometerQueue.setColumnRadius(20);

    ThermometerPlot cpuThermometerQueue = new ThermometerPlot(datasetQueueCPU);
    cpuThermometerQueue.setRange(0, 50);

    cpuThermometerQueue.setSubrange(ThermometerPlot.NORMAL, 0.0, 10.0);
    cpuThermometerQueue.setSubrange(ThermometerPlot.WARNING, 10.0, 25.0);
    cpuThermometerQueue.setSubrange(ThermometerPlot.CRITICAL, 25.0, 5000.0);
    cpuThermometerQueue.setUnits(ThermometerPlot.UNITS_NONE);
    cpuThermometerQueue.setBulbRadius(22);
    cpuThermometerQueue.setColumnRadius(20);

    panelCPUQueue.add("Center", new ChartPanel(
            new JFreeChart("CPU Queue", JFreeChart.DEFAULT_TITLE_FONT, cpuThermometerQueue, false)));
    panelCPUQueue.add("South", new Label(""));

    panelGPUQueue.add("Center", new ChartPanel(
            new JFreeChart("GPU Queue", JFreeChart.DEFAULT_TITLE_FONT, gpuThermometerQueue, false)));
    panelGPUQueue.add("South", new Label(""));
}

From source file:KIDLYFactory.java

/**
 * Creates and returns a default instance of a high-low-open-close chart
 * with a special timeline. This timeline can be a
 * {@link org.jfree.chart.axis.SegmentedTimeline} such as the Monday
 * through Friday timeline that will remove Saturdays and Sundays from
 * the axis./*from  w  w  w . j  a v  a 2 s. c  o m*/
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param timeAxisLabel  a label for the time axis (<code>null</code>
 *                       permitted).
 * @param valueAxisLabel  a label for the value axis (<code>null</code>
 *                        permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param timeline  the timeline.
 * @param legend  a flag specifying whether or not a legend is required.
 *
 * @return A high-low-open-close chart.
 */
public static JFreeChart createHighLowChart(String title, String timeAxisLabel, String valueAxisLabel,
        OHLCDataset dataset, Timeline timeline, boolean legend) {

    DateAxis timeAxis = new DateAxis(timeAxisLabel);
    timeAxis.setTimeline(timeline);
    NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
    HighLowRenderer renderer = new HighLowRenderer();
    renderer.setBaseToolTipGenerator(new HighLowItemLabelGenerator());
    XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, renderer);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    currentTheme.apply(chart);
    return chart;

}

From source file:hpssim.grafica.HPSsim.java

private JFreeChart createChart(ValueDataset valuedataset, String name) {
    MeterPlot meterplot = new MeterPlot(valuedataset);
    meterplot.addInterval(new MeterInterval("High", new Range(80D, 100D)));
    meterplot.setDialOutlinePaint(Color.white);

    JFreeChart jfreechart = new JFreeChart(name, JFreeChart.DEFAULT_TITLE_FONT, meterplot, false);
    return jfreechart;
}

From source file:edu.dlnu.liuwenpeng.ChartFactory.ChartFactory.java

/**    
 * Creates a bubble chart with default settings.  The chart is composed of    
 * an {@link XYPlot}, with a {@link NumberAxis} for the domain axis,    
 * a {@link NumberAxis} for the range axis, and an {@link XYBubbleRenderer}    
 * to draw the data items.    /*from   w  w w.j  a  va 2  s  . c om*/
 *    
 * @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 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 bubble chart.    
 */
public static JFreeChart createBubbleChart(String title, String xAxisLabel, String yAxisLabel,
        XYZDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) {

    if (orientation == null) {
        throw new IllegalArgumentException("Null 'orientation' argument.");
    }
    NumberAxis xAxis = new NumberAxis(xAxisLabel);
    xAxis.setAutoRangeIncludesZero(false);
    NumberAxis yAxis = new NumberAxis(yAxisLabel);
    yAxis.setAutoRangeIncludesZero(false);

    XYPlot plot = new XYPlot(dataset, xAxis, yAxis, null);

    XYItemRenderer renderer = new XYBubbleRenderer(XYBubbleRenderer.SCALE_ON_RANGE_AXIS);
    if (tooltips) {
        renderer.setBaseToolTipGenerator(new StandardXYZToolTipGenerator());
    }
    if (urls) {
        renderer.setURLGenerator(new StandardXYZURLGenerator());
    }
    plot.setRenderer(renderer);
    plot.setOrientation(orientation);

    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);

    return chart;

}

From source file:KIDLYFactory.java

/**
 * Creates a bubble chart with default settings.  The chart is composed of
 * an {@link XYPlot}, with a {@link NumberAxis} for the domain axis,
 * a {@link NumberAxis} for the range axis, and an {@link XYBubbleRenderer}
 * to draw the data items./*from   w  ww .  j  av a2  s  .  co  m*/
 *
 * @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 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 bubble chart.
 */
public static JFreeChart createBubbleChart(String title, String xAxisLabel, String yAxisLabel,
        XYZDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) {

    if (orientation == null) {
        throw new IllegalArgumentException("Null 'orientation' argument.");
    }
    NumberAxis xAxis = new NumberAxis(xAxisLabel);
    xAxis.setAutoRangeIncludesZero(false);
    NumberAxis yAxis = new NumberAxis(yAxisLabel);
    yAxis.setAutoRangeIncludesZero(false);

    XYPlot plot = new XYPlot(dataset, xAxis, yAxis, null);

    XYItemRenderer renderer = new XYBubbleRenderer(XYBubbleRenderer.SCALE_ON_RANGE_AXIS);
    if (tooltips) {
        renderer.setBaseToolTipGenerator(new StandardXYZToolTipGenerator());
    }
    if (urls) {
        renderer.setURLGenerator(new StandardXYZURLGenerator());
    }
    plot.setRenderer(renderer);
    plot.setOrientation(orientation);

    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    currentTheme.apply(chart);
    return chart;

}

From source file:edu.dlnu.liuwenpeng.ChartFactory.ChartFactory.java

/**    
 * Creates a histogram chart.  This chart is constructed with an     
 * {@link XYPlot} using an {@link XYBarRenderer}.  The domain and range     
 * axes are {@link NumberAxis} instances.    
 *    /*from w  w  w .  j  a  v  a 2 s  .c om*/
 * @param title  the chart title (<code>null</code> permitted).    
 * @param xAxisLabel  the x axis label (<code>null</code> permitted).    
 * @param yAxisLabel  the y axis label (<code>null</code> permitted).    
 * @param dataset  the dataset (<code>null</code> permitted).    
 * @param orientation  the orientation (horizontal or vertical)     
 *                     (<code>null</code> NOT permitted).    
 * @param legend  create a legend?    
 * @param tooltips  display tooltips?    
 * @param urls  generate URLs?    
 *    
 * @return The chart.    
 */
public static JFreeChart createHistogram(String title, String xAxisLabel, String yAxisLabel,
        IntervalXYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips,
        boolean urls) {

    if (orientation == null) {
        throw new IllegalArgumentException("Null 'orientation' argument.");
    }
    NumberAxis xAxis = new NumberAxis(xAxisLabel);
    xAxis.setAutoRangeIncludesZero(false);
    ValueAxis yAxis = new NumberAxis(yAxisLabel);

    XYItemRenderer renderer = new XYBarRenderer();
    if (tooltips) {
        renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
    }
    if (urls) {
        renderer.setURLGenerator(new StandardXYURLGenerator());
    }

    XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer);
    plot.setOrientation(orientation);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    return chart;

}

From source file:whitebox.stats.Kriging.java

/**
 * It gets the semivariogram type and bins list and draw a graph for them
 * TheoryVariogram should be called first
 *
 * @param bins/*  w ww .j  a va  2  s  .com*/
 * @param variogram
 */
public void DrawSemivariogram(bin[][] bins, Variogram variogram) {
    XYSeriesCollection sampleCollct = new XYSeriesCollection();
    XYSeries series = new XYSeries("Sample Variogram");
    //        for (Iterator<bin> i = bins.iterator(); i.hasNext(); )
    //        {
    //            series.add(bins.get(j).Distance,bins.get(j).Value);
    //            i.next();
    //            j++;
    //        }
    XYLineAndShapeRenderer xylineshapRend = new XYLineAndShapeRenderer(false, true);
    CombinedRangeXYPlot combinedrangexyplot = new CombinedRangeXYPlot();
    for (int i = 0; i < bins[0].length; i++) {
        for (int k = 0; k < bins.length; k++) {
            if (!Double.isNaN(bins[k][i].Value)) {
                series.add(bins[k][i].Distance, bins[k][i].Value);
            }
        }
        sampleCollct.addSeries(series);
        double[][] res = CalcTheoreticalSVValues(variogram, series.getMaxX());
        XYSeries seriesTSV = new XYSeries("Theoretical Variogram");
        for (int l = 0; l < res.length; l++) {
            seriesTSV.add(res[l][0], res[l][1]);
        }
        XYSeriesCollection theorCollct = new XYSeriesCollection();
        theorCollct.addSeries(seriesTSV);

        XYDataset xydataset = sampleCollct;

        XYPlot xyplot1 = new XYPlot(xydataset, new NumberAxis(), null, xylineshapRend);

        xyplot1.setDataset(1, theorCollct);
        XYLineAndShapeRenderer lineshapRend = new XYLineAndShapeRenderer(true, false);
        xyplot1.setRenderer(1, lineshapRend);
        xyplot1.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);
        combinedrangexyplot.add(xyplot1);
    }

    DecimalFormat df = new DecimalFormat("###,##0.000");
    String title = "Semivariogram (RMSE = " + df.format(Math.sqrt(variogram.mse)) + ")";
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, combinedrangexyplot, true);

    //        JFreeChart chart = ChartFactory.createScatterPlot(
    //            "Semivariogram", // chart title
    //            "Distance", // x axis label
    //            "Moment of Inertia", // y axis label
    //            result, // data  
    //            PlotOrientation.VERTICAL,
    //            true, // include legend
    //            true, // tooltips
    //            false // urls
    //            );
    // create and display a frame...
    ChartFrame frame = new ChartFrame("Semivariogram", chart);
    frame.pack();
    frame.setVisible(true);
}