afreechart/src/main/java/org/afree/data/DataUtilities.java
/**
     * Returns the total of the values in one column of the supplied data
     * table by taking only the row numbers in the array into account.
     *
     * @param data  the table of values (<code>null</code> not permitted).
     * @param column  the column index (zero-based).
     * @param validRows the array with valid rows (zero-based).
     *
     * @return The total of the valid values in the specified column.
     *
     * @since JFreeChart 1.0.13
     */
Returns the total of the values in one column of the supplied data
table by taking only the row numbers in the array into account.

@param data  the table of values (null not permitted).
@param column  the column index (zero-based).
@param validRows the array with valid rows (zero-based).

@return The total of the valid values in the specified column.


Returns the total of the values in one column of the supplied data table by taking only the row numbers in the array into account . @param data the table of values ( null not permitted ) . @param column the column index ( zero - based ) . @param validRows the array with valid rows ( zero - based ) . @return The total of the valid values in the specified column .
public static double calculateColumnTotal(Values2D data, int column,
             int[] validRows) {
        if (data == null) {
            throw new IllegalArgumentException("Null 'data' argument.");
        }
        double total = 0.0;
        int rowCount = data.getRowCount();
        for (int v = 0; v < validRows.length; v++) {
            int row = validRows[v];
            if (row < rowCount) {
                Number n = data.getValue(row, column);
                if (n != null) {
                    total += n.doubleValue();
                }
            }
        }
        return total;
    }
public static double calculateColumnTotal ( Values2D data , int column , int [ ] validRows ) { if ( data == null ) { throw new IllegalArgumentException ( "Null 'data' argument." ) ; } double total = 0.0 ; int rowCount = data . getRowCount ( ) ; for ( int v = 0 ; v < validRows . length ; v ++ ) { int row = validRows [ v ] ; if ( row < rowCount ) { Number n = data . getValue ( row , column ) ; if ( n != null ) { total += n . doubleValue ( ) ; } } } return total ; }
Returns the total of the values in one column of the supplied data
 table by taking only the row numbers in the array into account.
Returns the total of the values in one column of the supplied data table by taking only the row numbers in the array into account .