Java Code Examples for org.jfree.data.general.DatasetUtilities#findStackedRangeBounds()

The following examples show how to use org.jfree.data.general.DatasetUtilities#findStackedRangeBounds() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StackedXYBarRenderer.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns the range of values the renderer requires to display all the
 * items from the specified dataset.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 *
 * @return The range (<code>null</code> if the dataset is <code>null</code>
 *         or empty).
 */
@Override
public Range findRangeBounds(XYDataset dataset) {
    if (dataset != null) {
        if (this.renderAsPercentages) {
            return new Range(0.0, 1.0);
        }
        else {
            return DatasetUtilities.findStackedRangeBounds(
                    (TableXYDataset) dataset);
        }
    }
    else {
        return null;
    }
}
 
Example 2
Source File: StackedBarRenderer.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the range of values the renderer requires to display all the
 * items from the specified dataset.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 *
 * @return The range (or <code>null</code> if the dataset is empty).
 */
@Override
public Range findRangeBounds(CategoryDataset dataset) {
    if (dataset == null) {
        return null;
    }
    if (this.renderAsPercentages) {
        return new Range(0.0, 1.0);
    }
    else {
        return DatasetUtilities.findStackedRangeBounds(dataset, getBase());
    }
}
 
Example 3
Source File: StackedAreaRenderer.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Returns the range of values the renderer requires to display all the items from the specified dataset.
 *
 * @param dataset the dataset (<code>null</code> not permitted).
 * @return The range (or <code>null</code> if the dataset is empty).
 */
public Range findRangeBounds( final CategoryDataset dataset ) {
  if ( dataset == null ) {
    return null;
  }
  if ( this.renderAsPercentages ) {
    return new Range( 0.0, 1.0 );
  } else {
    return DatasetUtilities.findStackedRangeBounds( dataset );
  }
}
 
Example 4
Source File: GroupedStackedBarRenderer.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns the range of values the renderer requires to display all the
 * items from the specified dataset.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 *
 * @return The range (or <code>null</code> if the dataset is
 *         <code>null</code> or empty).
 */
@Override
public Range findRangeBounds(CategoryDataset dataset) {
    if (dataset == null) {
        return null;
    }
    Range r = DatasetUtilities.findStackedRangeBounds(
            dataset, this.seriesToGroupMap);
    return r;
}
 
Example 5
Source File: GroupedStackedBarRenderer.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the range of values the renderer requires to display all the
 * items from the specified dataset.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 *
 * @return The range (or <code>null</code> if the dataset is
 *         <code>null</code> or empty).
 */
@Override
public Range findRangeBounds(CategoryDataset dataset) {
    if (dataset == null) {
        return null;
    }
    Range r = DatasetUtilities.findStackedRangeBounds(
            dataset, this.seriesToGroupMap);
    return r;
}
 
Example 6
Source File: Test.java    From IntelliJDeodorant with MIT License 5 votes vote down vote up
public Range findRangeBounds(CategoryDataset dataset) {
    if (dataset == null) {
        return null;
    }
    if (this.renderAsPercentages) {
        return new Range(0.0, 1.0);
    } else {
        return DatasetUtilities.findStackedRangeBounds(dataset);
    }
}
 
Example 7
Source File: StackedBarRenderer3D.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the range of values the renderer requires to display all the
 * items from the specified dataset.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 *
 * @return The range (or <code>null</code> if the dataset is empty).
 */
public Range findRangeBounds(CategoryDataset dataset) {
    if (dataset == null) {
        return null;
    }
    if (this.renderAsPercentages) {
        return new Range(0.0, 1.0);
    }
    else {
        return DatasetUtilities.findStackedRangeBounds(dataset);
    }
}
 
Example 8
Source File: StackedBarRenderer.java    From opensim-gui with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the range of values the renderer requires to display all the
 * items from the specified dataset.
 * 
 * @param dataset  the dataset (<code>null</code> permitted).
 * 
 * @return The range (or <code>null</code> if the dataset is empty).
 */
public Range findRangeBounds(CategoryDataset dataset) {
    if (this.renderAsPercentages) {
        return new Range(0.0, 1.0);   
    }
    else {
        return DatasetUtilities.findStackedRangeBounds(dataset, getBase());
    }
}
 
Example 9
Source File: DatasetUtilitiesTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Some checks for the findStackedRangeBounds(CategoryDataset,
 * KeyToGroupMap) method.
 */
public void testFindStackedRangeBounds_CategoryDataset3() {
    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    KeyToGroupMap map = new KeyToGroupMap("Group A");
    Range r = DatasetUtilities.findStackedRangeBounds(dataset, map);
    assertTrue(r == null);

    dataset.addValue(1.0, "R1", "C1");
    dataset.addValue(2.0, "R2", "C1");
    dataset.addValue(3.0, "R3", "C1");
    dataset.addValue(4.0, "R4", "C1");

    map.mapKeyToGroup("R1", "Group A");
    map.mapKeyToGroup("R2", "Group A");
    map.mapKeyToGroup("R3", "Group B");
    map.mapKeyToGroup("R4", "Group B");

    r = DatasetUtilities.findStackedRangeBounds(dataset, map);
    assertEquals(0.0, r.getLowerBound(), EPSILON);
    assertEquals(7.0, r.getUpperBound(), EPSILON);

    dataset.addValue(null, "R5", "C1");
    r = DatasetUtilities.findStackedRangeBounds(dataset, map);
    assertEquals(0.0, r.getLowerBound(), EPSILON);
    assertEquals(7.0, r.getUpperBound(), EPSILON);

    dataset.addValue(Double.NaN, "R6", "C1");
    r = DatasetUtilities.findStackedRangeBounds(dataset, map);
    assertEquals(0.0, r.getLowerBound(), EPSILON);
    assertEquals(7.0, r.getUpperBound(), EPSILON);
}
 
Example 10
Source File: GroupedStackedBarRenderer.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns the range of values the renderer requires to display all the
 * items from the specified dataset.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 *
 * @return The range (or <code>null</code> if the dataset is
 *         <code>null</code> or empty).
 */
@Override
public Range findRangeBounds(CategoryDataset dataset) {
    if (dataset == null) {
        return null;
    }
    Range r = DatasetUtilities.findStackedRangeBounds(
            dataset, this.seriesToGroupMap);
    return r;
}
 
Example 11
Source File: StackedBarRenderer3D.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the range of values the renderer requires to display all the
 * items from the specified dataset.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 *
 * @return The range (or <code>null</code> if the dataset is empty).
 */
@Override
public Range findRangeBounds(CategoryDataset dataset) {
    if (dataset == null) {
        return null;
    }
    if (this.renderAsPercentages) {
        return new Range(0.0, 1.0);
    }
    return DatasetUtilities.findStackedRangeBounds(dataset);
}
 
Example 12
Source File: StackedAreaRenderer.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns the range of values the renderer requires to display all the
 * items from the specified dataset.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 *
 * @return The range (or <code>null</code> if the dataset is empty).
 */
@Override
public Range findRangeBounds(CategoryDataset dataset) {
    if (dataset == null) {
        return null;
    }
    if (this.renderAsPercentages) {
        return new Range(0.0, 1.0);
    }
    else {
        return DatasetUtilities.findStackedRangeBounds(dataset);
    }
}
 
Example 13
Source File: StackedAreaRenderer.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the range of values the renderer requires to display all the
 * items from the specified dataset.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 *
 * @return The range (or <code>null</code> if the dataset is empty).
 */
@Override
public Range findRangeBounds(CategoryDataset dataset) {
    if (dataset == null) {
        return null;
    }
    if (this.renderAsPercentages) {
        return new Range(0.0, 1.0);
    }
    else {
        return DatasetUtilities.findStackedRangeBounds(dataset);
    }
}
 
Example 14
Source File: DatasetUtilitiesTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Some checks for the findStackedRangeBounds() method.
 */
public void testFindStackedRangeBounds_CategoryDataset1() {
    CategoryDataset d1 = createCategoryDataset1();
    Range r = DatasetUtilities.findStackedRangeBounds(d1);
    assertEquals(0.0, r.getLowerBound(), EPSILON);
    assertEquals(15.0, r.getUpperBound(), EPSILON);

    d1 = createCategoryDataset2();
    r = DatasetUtilities.findStackedRangeBounds(d1);
    assertEquals(-2.0, r.getLowerBound(), EPSILON);
    assertEquals(2.0, r.getUpperBound(), EPSILON);
}
 
Example 15
Source File: DatasetUtilitiesTests.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Some checks for the findStackedRangeBounds() method.
 */
public void testFindStackedRangeBoundsForTableXYDataset2() {
    DefaultTableXYDataset d = new DefaultTableXYDataset();
    Range r = DatasetUtilities.findStackedRangeBounds(d);
    assertEquals(r, new Range(0.0, 0.0));
}
 
Example 16
Source File: StackedXYAreaRenderer.java    From buffer_bci with GNU General Public License v3.0 3 votes vote down vote up
/**
 * Returns the range of values the renderer requires to display all the
 * items from the specified dataset.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 *
 * @return The range ([0.0, 0.0] if the dataset contains no values, and
 *         <code>null</code> if the dataset is <code>null</code>).
 *
 * @throws ClassCastException if <code>dataset</code> is not an instance
 *         of {@link TableXYDataset}.
 */
@Override
public Range findRangeBounds(XYDataset dataset) {
    if (dataset != null) {
        return DatasetUtilities.findStackedRangeBounds(
            (TableXYDataset) dataset);
    }
    else {
        return null;
    }
}
 
Example 17
Source File: StackedXYAreaRenderer.java    From buffer_bci with GNU General Public License v3.0 3 votes vote down vote up
/**
 * Returns the range of values the renderer requires to display all the
 * items from the specified dataset.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 *
 * @return The range ([0.0, 0.0] if the dataset contains no values, and
 *         <code>null</code> if the dataset is <code>null</code>).
 *
 * @throws ClassCastException if <code>dataset</code> is not an instance
 *         of {@link TableXYDataset}.
 */
@Override
public Range findRangeBounds(XYDataset dataset) {
    if (dataset != null) {
        return DatasetUtilities.findStackedRangeBounds(
            (TableXYDataset) dataset);
    }
    else {
        return null;
    }
}
 
Example 18
Source File: GroupedStackedBarRenderer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns the range of values the renderer requires to display all the
 * items from the specified dataset.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 *
 * @return The range (or <code>null</code> if the dataset is
 *         <code>null</code> or empty).
 */
public Range findRangeBounds(CategoryDataset dataset) {
    if (dataset == null) {
        return null;
    }
    Range r = DatasetUtilities.findStackedRangeBounds(
            dataset, this.seriesToGroupMap);
    return r;
}
 
Example 19
Source File: StackedXYAreaRenderer.java    From opensim-gui with Apache License 2.0 3 votes vote down vote up
/**
 * Returns the range of values the renderer requires to display all the 
 * items from the specified dataset.
 * 
 * @param dataset  the dataset (<code>null</code> permitted).
 * 
 * @return The range ([0.0, 0.0] if the dataset contains no values, and 
 *         <code>null</code> if the dataset is <code>null</code>).
 *         
 * @throws ClassCastException if <code>dataset</code> is not an instance
 *         of {@link TableXYDataset}.
 */
public Range findRangeBounds(XYDataset dataset) {
    if (dataset != null) {
        return DatasetUtilities.findStackedRangeBounds(
            (TableXYDataset) dataset);
    }
    else {
        return null;
    }
}
 
Example 20
Source File: StackedXYAreaRenderer.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns the range of values the renderer requires to display all the
 * items from the specified dataset.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 *
 * @return The range ([0.0, 0.0] if the dataset contains no values, and
 *         <code>null</code> if the dataset is <code>null</code>).
 *
 * @throws ClassCastException if <code>dataset</code> is not an instance
 *         of {@link TableXYDataset}.
 */
public Range findRangeBounds(XYDataset dataset) {
    if (dataset != null) {
        return DatasetUtilities.findStackedRangeBounds(
            (TableXYDataset) dataset);
    }
    else {
        return null;
    }
}