afreechart/src/main/java/org/afree/chart/ChartFactory.java
/**
     * Creates and returns a time series chart.  A time series chart is an
     * {@link XYPlot} with a {@link DateAxis} for the x-axis and a
     * {@link NumberAxis} for the y-axis.  The default renderer is an
     * {@link XYLineAndShapeRenderer}.
     * <P>
     * A convenient dataset to use with this chart is a
     * {@link org.afree.data.time.TimeSeriesCollection}.
     *
     * @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.
     * @param tooltips  configure chart to generate tool tips?
     * @param urls  configure chart to generate URLs?
     *
     * @return A time series chart.
     */
Creates and returns a time series chart.  A time series chart is an
XYPlot with a  DateAxis for the x-axis and a
NumberAxis for the y-axis.  The default renderer is an
XYLineAndShapeRenderer.

A convenient dataset to use with this chart is a
org.afree.data.time.TimeSeriesCollection.

@param title  the chart title (null permitted).
@param timeAxisLabel  a label for the time axis (null
permitted).
@param valueAxisLabel  a label for the value axis (null
permitted).
@param dataset  the dataset for the chart (null permitted).
@param legend  a flag specifying whether or not a legend is required.
@param tooltips  configure chart to generate tool tips.

@return A time series chart.
Creates and returns a time series chart . A time series chart is an XYPlot with a DateAxis for the x - axis and a NumberAxis for the y - axis . The default renderer is an XYLineAndShapeRenderer . A convenient dataset to use with this chart is a org . afree . data . time . TimeSeriesCollection . @param title the chart title ( null permitted ) . @param timeAxisLabel a label for the time axis ( null permitted ) . @param valueAxisLabel a label for the value axis ( null permitted ) . @param dataset the dataset for the chart ( null permitted ) . @param legend a flag specifying whether or not a legend is required . @param tooltips configure chart to generate tool tips . @return A time series chart .
public static AFreeChart createTimeSeriesChart(String title,
                                                   String timeAxisLabel,
                                                   String valueAxisLabel,
                                                   XYDataset dataset,
                                                   boolean legend,
                                                   boolean tooltips,
                                                   boolean urls) {
        ValueAxis timeAxis = new DateAxis(timeAxisLabel);
        timeAxis.setLowerMargin(0.02);  
        timeAxis.setUpperMargin(0.02);
        NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
        valueAxis.setAutoRangeIncludesZero(false);  
        XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, null);
        XYURLGenerator urlGenerator = null;
        if (urls) {
            urlGenerator = new StandardXYURLGenerator();
        XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true,
                false);
        renderer.setBaseToolTipGenerator(toolTipGenerator);
        renderer.setURLGenerator(urlGenerator);
        plot.setRenderer(renderer);
        AFreeChart chart = new AFreeChart(title, AFreeChart.DEFAULT_TITLE_FONT,
                plot, legend);
        currentTheme.apply(chart);
        return chart;
    }
public static AFreeChart createTimeSeriesChart ( String title , String timeAxisLabel , String valueAxisLabel , XYDataset dataset , boolean legend , boolean tooltips , boolean urls ) { ValueAxis timeAxis = new DateAxis ( timeAxisLabel ) ; timeAxis . setLowerMargin ( 0.02 ) ; timeAxis . setUpperMargin ( 0.02 ) ; NumberAxis valueAxis = new NumberAxis ( valueAxisLabel ) ; valueAxis . setAutoRangeIncludesZero ( false ) ; XYPlot plot = new XYPlot ( dataset , timeAxis , valueAxis , null ) ; XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer ( true , false ) ; plot . setRenderer ( renderer ) ; AFreeChart chart = new AFreeChart ( title , AFreeChart . DEFAULT_TITLE_FONT , plot , legend ) ; return chart ; }
Creates and returns a time series chart.
Creates and returns a time series chart .
// reduce the default margins // override default //        XYToolTipGenerator toolTipGenerator = null; //        if (tooltips) { //            toolTipGenerator //                = StandardXYToolTipGenerator.getTimeSeriesInstance(); //        } // //        XYURLGenerator urlGenerator = null; //        if (urls) { //            urlGenerator = new StandardXYURLGenerator(); //        } //        renderer.setBaseToolTipGenerator(toolTipGenerator); //        renderer.setURLGenerator(urlGenerator); //        currentTheme.apply(chart);