afreechart/src/main/java/org/afree/data/time/MovingAverage.java
/**
     * Creates a new {@link XYDataset} containing the moving averages of each
     * series in the <code>source</code> dataset.
     *
     * @param source  the source dataset.
     * @param suffix  the string to append to source series names to create
     *                target series names.
     * @param period  the averaging period.
     * @param skip  the length of the initial skip period.
     *
     * @return The dataset.
     */
Creates a new  XYDataset containing the moving averages of each
series in the source dataset.

@param source  the source dataset.
@param suffix  the string to append to source series names to create
target series names.
@param period  the averaging period.
@param skip  the length of the initial skip period.

@return The dataset.
Creates a new XYDataset containing the moving averages of each series in the source dataset . @param source the source dataset . @param suffix the string to append to source series names to create target series names . @param period the averaging period . @param skip the length of the initial skip period . @return The dataset .
public static XYDataset createMovingAverage(XYDataset source,
            String suffix, double period, double skip) {
        if (source == null) {
            throw new IllegalArgumentException("Null source (XYDataset).");
        }
        XYSeriesCollection result = new XYSeriesCollection();
        for (int i = 0; i < source.getSeriesCount(); i++) {
            XYSeries s = createMovingAverage(source, i, source.getSeriesKey(i)
                    + suffix, period, skip);
            result.addSeries(s);
        }
        return result;
    }
public static XYDataset createMovingAverage ( XYDataset source , String suffix , double period , double skip ) { if ( source == null ) { throw new IllegalArgumentException ( "Null source (XYDataset)." ) ; } XYSeriesCollection result = new XYSeriesCollection ( ) ; for ( int i = 0 ; i < source . getSeriesCount ( ) ; i ++ ) { XYSeries s = createMovingAverage ( source , i , source . getSeriesKey ( i ) + suffix , period , skip ) ; result . addSeries ( s ) ; } return result ; }
Creates a new {@link XYDataset} containing the moving averages of each
 series in the <code>source</code> dataset.
Creates a new { @link XYDataset } containing the moving averages of each series in the <code > source< / code > dataset .