Java Code Examples for org.jfree.data.xy.TableXYDataset#getItemCount()
The following examples show how to use
org.jfree.data.xy.TableXYDataset#getItemCount() .
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: StackedXYAreaRenderer2.java From ccu-historian with GNU General Public License v3.0 | 6 votes |
/** * 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(XYDataset dataset) { if (dataset == null) { return null; } double min = Double.POSITIVE_INFINITY; double max = Double.NEGATIVE_INFINITY; TableXYDataset d = (TableXYDataset) dataset; int itemCount = d.getItemCount(); for (int i = 0; i < itemCount; i++) { double[] stackValues = getStackValues((TableXYDataset) dataset, d.getSeriesCount(), i); min = Math.min(min, stackValues[0]); max = Math.max(max, stackValues[1]); } if (min == Double.POSITIVE_INFINITY) { return null; } return new Range(min, max); }
Example 2
Source File: StackedXYAreaRenderer2.java From astor with GNU General Public License v2.0 | 6 votes |
/** * 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(XYDataset dataset) { if (dataset == null) { return null; } double min = Double.POSITIVE_INFINITY; double max = Double.NEGATIVE_INFINITY; TableXYDataset d = (TableXYDataset) dataset; int itemCount = d.getItemCount(); for (int i = 0; i < itemCount; i++) { double[] stackValues = getStackValues((TableXYDataset) dataset, d.getSeriesCount(), i); min = Math.min(min, stackValues[0]); max = Math.max(max, stackValues[1]); } if (min == Double.POSITIVE_INFINITY) { return null; } return new Range(min, max); }
Example 3
Source File: StackedXYAreaRenderer2.java From SIMVA-SoS with Apache License 2.0 | 6 votes |
/** * 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(XYDataset dataset) { if (dataset == null) { return null; } double min = Double.POSITIVE_INFINITY; double max = Double.NEGATIVE_INFINITY; TableXYDataset d = (TableXYDataset) dataset; int itemCount = d.getItemCount(); for (int i = 0; i < itemCount; i++) { double[] stackValues = getStackValues((TableXYDataset) dataset, d.getSeriesCount(), i); min = Math.min(min, stackValues[0]); max = Math.max(max, stackValues[1]); } if (min == Double.POSITIVE_INFINITY) { return null; } return new Range(min, max); }
Example 4
Source File: StackedXYAreaRenderer2.java From astor with GNU General Public License v2.0 | 6 votes |
/** * 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(XYDataset dataset) { if (dataset == null) { return null; } double min = Double.POSITIVE_INFINITY; double max = Double.NEGATIVE_INFINITY; TableXYDataset d = (TableXYDataset) dataset; int itemCount = d.getItemCount(); for (int i = 0; i < itemCount; i++) { double[] stackValues = getStackValues((TableXYDataset) dataset, d.getSeriesCount(), i); min = Math.min(min, stackValues[0]); max = Math.max(max, stackValues[1]); } if (min == Double.POSITIVE_INFINITY) { return null; } return new Range(min, max); }
Example 5
Source File: StackedXYAreaRenderer2.java From opensim-gui with Apache License 2.0 | 6 votes |
/** * 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(XYDataset dataset) { if (dataset == null) { return null; } double min = Double.POSITIVE_INFINITY; double max = Double.NEGATIVE_INFINITY; TableXYDataset d = (TableXYDataset) dataset; int itemCount = d.getItemCount(); for (int i = 0; i < itemCount; i++) { double[] stackValues = getStackValues((TableXYDataset) dataset, d.getSeriesCount(), i); min = Math.min(min, stackValues[0]); max = Math.max(max, stackValues[1]); } if (min == Double.POSITIVE_INFINITY) { return null; } return new Range(min, max); }
Example 6
Source File: StackedXYAreaRenderer2.java From openstock with GNU General Public License v3.0 | 6 votes |
/** * 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(XYDataset dataset) { if (dataset == null) { return null; } double min = Double.POSITIVE_INFINITY; double max = Double.NEGATIVE_INFINITY; TableXYDataset d = (TableXYDataset) dataset; int itemCount = d.getItemCount(); for (int i = 0; i < itemCount; i++) { double[] stackValues = getStackValues((TableXYDataset) dataset, d.getSeriesCount(), i); min = Math.min(min, stackValues[0]); max = Math.max(max, stackValues[1]); } if (min == Double.POSITIVE_INFINITY) { return null; } return new Range(min, max); }
Example 7
Source File: JGenProg2017_0047_s.java From coming with MIT License | 5 votes |
/** * Returns the minimum and maximum values for the dataset's range, * assuming that the series are stacked, using the specified base value. * * @param dataset the dataset (<code>null</code> not permitted). * @param base the base value. * * @return The range (<code>null</code> if the dataset contains no values). */ public static Range findStackedRangeBounds(TableXYDataset dataset, double base) { if (dataset == null) { throw new IllegalArgumentException("Null 'dataset' argument."); } double minimum = base; double maximum = base; for (int itemNo = 0; itemNo < dataset.getItemCount(); itemNo++) { double positive = base; double negative = base; int seriesCount = dataset.getSeriesCount(); for (int seriesNo = 0; seriesNo < seriesCount; seriesNo++) { double y = dataset.getYValue(seriesNo, itemNo); if (!Double.isNaN(y)) { if (y > 0.0) { positive += y; } else { negative += y; } } } if (positive > maximum) { maximum = positive; } if (negative < minimum) { minimum = negative; } } if (minimum <= maximum) { return new Range(minimum, maximum); } else { return null; } }
Example 8
Source File: DatasetUtilities.java From astor with GNU General Public License v2.0 | 5 votes |
/** * Returns the minimum and maximum values for the dataset's range, * assuming that the series are stacked, using the specified base value. * * @param dataset the dataset (<code>null</code> not permitted). * @param base the base value. * * @return The range (<code>null</code> if the dataset contains no values). */ public static Range findStackedRangeBounds(TableXYDataset dataset, double base) { if (dataset == null) { throw new IllegalArgumentException("Null 'dataset' argument."); } double minimum = base; double maximum = base; for (int itemNo = 0; itemNo < dataset.getItemCount(); itemNo++) { double positive = base; double negative = base; int seriesCount = dataset.getSeriesCount(); for (int seriesNo = 0; seriesNo < seriesCount; seriesNo++) { double y = dataset.getYValue(seriesNo, itemNo); if (!Double.isNaN(y)) { if (y > 0.0) { positive += y; } else { negative += y; } } } if (positive > maximum) { maximum = positive; } if (negative < minimum) { minimum = negative; } } if (minimum <= maximum) { return new Range(minimum, maximum); } else { return null; } }
Example 9
Source File: DatasetUtilities.java From opensim-gui with Apache License 2.0 | 5 votes |
/** * Returns the minimum and maximum values for the dataset's range, * assuming that the series are stacked, using the specified base value. * * @param dataset the dataset (<code>null</code> not permitted). * @param base the base value. * * @return The range (<code>null</code> if the dataset contains no values). */ public static Range findStackedRangeBounds(TableXYDataset dataset, double base) { if (dataset == null) { throw new IllegalArgumentException("Null 'dataset' argument."); } double minimum = base; double maximum = base; for (int itemNo = 0; itemNo < dataset.getItemCount(); itemNo++) { double positive = base; double negative = base; int seriesCount = dataset.getSeriesCount(); for (int seriesNo = 0; seriesNo < seriesCount; seriesNo++) { double y = dataset.getYValue(seriesNo, itemNo); if (!Double.isNaN(y)) { if (y > 0.0) { positive += y; } else { negative += y; } } } if (positive > maximum) { maximum = positive; } if (negative < minimum) { minimum = negative; } } if (minimum <= maximum) { return new Range(minimum, maximum); } else { return null; } }
Example 10
Source File: DatasetUtilities.java From ECG-Viewer with GNU General Public License v2.0 | 5 votes |
/** * Returns the minimum and maximum values for the dataset's range, * assuming that the series are stacked, using the specified base value. * * @param dataset the dataset (<code>null</code> not permitted). * @param base the base value. * * @return The range (<code>null</code> if the dataset contains no values). */ public static Range findStackedRangeBounds(TableXYDataset dataset, double base) { ParamChecks.nullNotPermitted(dataset, "dataset"); double minimum = base; double maximum = base; for (int itemNo = 0; itemNo < dataset.getItemCount(); itemNo++) { double positive = base; double negative = base; int seriesCount = dataset.getSeriesCount(); for (int seriesNo = 0; seriesNo < seriesCount; seriesNo++) { double y = dataset.getYValue(seriesNo, itemNo); if (!Double.isNaN(y)) { if (y > 0.0) { positive += y; } else { negative += y; } } } if (positive > maximum) { maximum = positive; } if (negative < minimum) { minimum = negative; } } if (minimum <= maximum) { return new Range(minimum, maximum); } else { return null; } }
Example 11
Source File: Chart_2_DatasetUtilities_t.java From coming with MIT License | 5 votes |
/** * Returns the minimum and maximum values for the dataset's range, * assuming that the series are stacked, using the specified base value. * * @param dataset the dataset (<code>null</code> not permitted). * @param base the base value. * * @return The range (<code>null</code> if the dataset contains no values). */ public static Range findStackedRangeBounds(TableXYDataset dataset, double base) { if (dataset == null) { throw new IllegalArgumentException("Null 'dataset' argument."); } double minimum = base; double maximum = base; for (int itemNo = 0; itemNo < dataset.getItemCount(); itemNo++) { double positive = base; double negative = base; int seriesCount = dataset.getSeriesCount(); for (int seriesNo = 0; seriesNo < seriesCount; seriesNo++) { double y = dataset.getYValue(seriesNo, itemNo); if (!Double.isNaN(y)) { if (y > 0.0) { positive += y; } else { negative += y; } } } if (positive > maximum) { maximum = positive; } if (negative < minimum) { minimum = negative; } } if (minimum <= maximum) { return new Range(minimum, maximum); } else { return null; } }
Example 12
Source File: Chart_2_DatasetUtilities_s.java From coming with MIT License | 5 votes |
/** * Returns the minimum and maximum values for the dataset's range, * assuming that the series are stacked, using the specified base value. * * @param dataset the dataset (<code>null</code> not permitted). * @param base the base value. * * @return The range (<code>null</code> if the dataset contains no values). */ public static Range findStackedRangeBounds(TableXYDataset dataset, double base) { if (dataset == null) { throw new IllegalArgumentException("Null 'dataset' argument."); } double minimum = base; double maximum = base; for (int itemNo = 0; itemNo < dataset.getItemCount(); itemNo++) { double positive = base; double negative = base; int seriesCount = dataset.getSeriesCount(); for (int seriesNo = 0; seriesNo < seriesCount; seriesNo++) { double y = dataset.getYValue(seriesNo, itemNo); if (!Double.isNaN(y)) { if (y > 0.0) { positive += y; } else { negative += y; } } } if (positive > maximum) { maximum = positive; } if (negative < minimum) { minimum = negative; } } if (minimum <= maximum) { return new Range(minimum, maximum); } else { return null; } }
Example 13
Source File: JGenProg2017_0047_t.java From coming with MIT License | 5 votes |
/** * Returns the minimum and maximum values for the dataset's range, * assuming that the series are stacked, using the specified base value. * * @param dataset the dataset (<code>null</code> not permitted). * @param base the base value. * * @return The range (<code>null</code> if the dataset contains no values). */ public static Range findStackedRangeBounds(TableXYDataset dataset, double base) { if (dataset == null) { throw new IllegalArgumentException("Null 'dataset' argument."); } double minimum = base; double maximum = base; for (int itemNo = 0; itemNo < dataset.getItemCount(); itemNo++) { double positive = base; double negative = base; int seriesCount = dataset.getSeriesCount(); for (int seriesNo = 0; seriesNo < seriesCount; seriesNo++) { double y = dataset.getYValue(seriesNo, itemNo); if (!Double.isNaN(y)) { if (y > 0.0) { positive += y; } else { negative += y; } } } if (positive > maximum) { maximum = positive; } if (negative < minimum) { minimum = negative; } } if (minimum <= maximum) { return new Range(minimum, maximum); } else { return null; } }
Example 14
Source File: Cardumen_00194_s.java From coming with MIT License | 5 votes |
/** * Returns the minimum and maximum values for the dataset's range, * assuming that the series are stacked, using the specified base value. * * @param dataset the dataset (<code>null</code> not permitted). * @param base the base value. * * @return The range (<code>null</code> if the dataset contains no values). */ public static Range findStackedRangeBounds(TableXYDataset dataset, double base) { if (dataset == null) { throw new IllegalArgumentException("Null 'dataset' argument."); } double minimum = base; double maximum = base; for (int itemNo = 0; itemNo < dataset.getItemCount(); itemNo++) { double positive = base; double negative = base; int seriesCount = dataset.getSeriesCount(); for (int seriesNo = 0; seriesNo < seriesCount; seriesNo++) { double y = dataset.getYValue(seriesNo, itemNo); if (!Double.isNaN(y)) { if (y > 0.0) { positive += y; } else { negative += y; } } } if (positive > maximum) { maximum = positive; } if (negative < minimum) { minimum = negative; } } if (minimum <= maximum) { return new Range(minimum, maximum); } else { return null; } }
Example 15
Source File: Cardumen_00194_t.java From coming with MIT License | 5 votes |
/** * Returns the minimum and maximum values for the dataset's range, * assuming that the series are stacked, using the specified base value. * * @param dataset the dataset (<code>null</code> not permitted). * @param base the base value. * * @return The range (<code>null</code> if the dataset contains no values). */ public static Range findStackedRangeBounds(TableXYDataset dataset, double base) { if (dataset == null) { throw new IllegalArgumentException("Null 'dataset' argument."); } double minimum = base; double maximum = base; for (int itemNo = 0; itemNo < dataset.getItemCount(); itemNo++) { double positive = base; double negative = base; int seriesCount = dataset.getSeriesCount(); for (int seriesNo = 0; seriesNo < seriesCount; seriesNo++) { double y = dataset.getYValue(seriesNo, itemNo); if (!Double.isNaN(y)) { if (y > 0.0) { positive += y; } else { negative += y; } } } if (positive > maximum) { maximum = positive; } if (negative < minimum) { minimum = negative; } } if (minimum <= maximum) { return new Range(minimum, maximum); } else { return null; } }
Example 16
Source File: Cardumen_0079_t.java From coming with MIT License | 5 votes |
/** * Returns the minimum and maximum values for the dataset's range, * assuming that the series are stacked, using the specified base value. * * @param dataset the dataset (<code>null</code> not permitted). * @param base the base value. * * @return The range (<code>null</code> if the dataset contains no values). */ public static Range findStackedRangeBounds(TableXYDataset dataset, double base) { if (dataset == null) { throw new IllegalArgumentException("Null 'dataset' argument."); } double minimum = base; double maximum = base; for (int itemNo = 0; itemNo < dataset.getItemCount(); itemNo++) { double positive = base; double negative = base; int seriesCount = dataset.getSeriesCount(); for (int seriesNo = 0; seriesNo < seriesCount; seriesNo++) { double y = dataset.getYValue(seriesNo, itemNo); if (!Double.isNaN(y)) { if (y > 0.0) { positive += y; } else { negative += y; } } } if (positive > maximum) { maximum = positive; } if (negative < minimum) { minimum = negative; } } if (minimum <= maximum) { return new Range(minimum, maximum); } else { return null; } }
Example 17
Source File: Cardumen_0079_s.java From coming with MIT License | 5 votes |
/** * Returns the minimum and maximum values for the dataset's range, * assuming that the series are stacked, using the specified base value. * * @param dataset the dataset (<code>null</code> not permitted). * @param base the base value. * * @return The range (<code>null</code> if the dataset contains no values). */ public static Range findStackedRangeBounds(TableXYDataset dataset, double base) { if (dataset == null) { throw new IllegalArgumentException("Null 'dataset' argument."); } double minimum = base; double maximum = base; for (int itemNo = 0; itemNo < dataset.getItemCount(); itemNo++) { double positive = base; double negative = base; int seriesCount = dataset.getSeriesCount(); for (int seriesNo = 0; seriesNo < seriesCount; seriesNo++) { double y = dataset.getYValue(seriesNo, itemNo); if (!Double.isNaN(y)) { if (y > 0.0) { positive += y; } else { negative += y; } } } if (positive > maximum) { maximum = positive; } if (negative < minimum) { minimum = negative; } } if (minimum <= maximum) { return new Range(minimum, maximum); } else { return null; } }
Example 18
Source File: DatasetUtilities.java From SIMVA-SoS with Apache License 2.0 | 5 votes |
/** * Returns the minimum and maximum values for the dataset's range, * assuming that the series are stacked, using the specified base value. * * @param dataset the dataset (<code>null</code> not permitted). * @param base the base value. * * @return The range (<code>null</code> if the dataset contains no values). */ public static Range findStackedRangeBounds(TableXYDataset dataset, double base) { ParamChecks.nullNotPermitted(dataset, "dataset"); double minimum = base; double maximum = base; for (int itemNo = 0; itemNo < dataset.getItemCount(); itemNo++) { double positive = base; double negative = base; int seriesCount = dataset.getSeriesCount(); for (int seriesNo = 0; seriesNo < seriesCount; seriesNo++) { double y = dataset.getYValue(seriesNo, itemNo); if (!Double.isNaN(y)) { if (y > 0.0) { positive += y; } else { negative += y; } } } if (positive > maximum) { maximum = positive; } if (negative < minimum) { minimum = negative; } } if (minimum <= maximum) { return new Range(minimum, maximum); } else { return null; } }
Example 19
Source File: DatasetUtilities.java From ccu-historian with GNU General Public License v3.0 | 5 votes |
/** * Returns the minimum and maximum values for the dataset's range, * assuming that the series are stacked, using the specified base value. * * @param dataset the dataset (<code>null</code> not permitted). * @param base the base value. * * @return The range (<code>null</code> if the dataset contains no values). */ public static Range findStackedRangeBounds(TableXYDataset dataset, double base) { ParamChecks.nullNotPermitted(dataset, "dataset"); double minimum = base; double maximum = base; for (int itemNo = 0; itemNo < dataset.getItemCount(); itemNo++) { double positive = base; double negative = base; int seriesCount = dataset.getSeriesCount(); for (int seriesNo = 0; seriesNo < seriesCount; seriesNo++) { double y = dataset.getYValue(seriesNo, itemNo); if (!Double.isNaN(y)) { if (y > 0.0) { positive += y; } else { negative += y; } } } if (positive > maximum) { maximum = positive; } if (negative < minimum) { minimum = negative; } } if (minimum <= maximum) { return new Range(minimum, maximum); } else { return null; } }
Example 20
Source File: DatasetUtilities.java From openstock with GNU General Public License v3.0 | 5 votes |
/** * Returns the minimum and maximum values for the dataset's range, * assuming that the series are stacked, using the specified base value. * * @param dataset the dataset (<code>null</code> not permitted). * @param base the base value. * * @return The range (<code>null</code> if the dataset contains no values). */ public static Range findStackedRangeBounds(TableXYDataset dataset, double base) { ParamChecks.nullNotPermitted(dataset, "dataset"); double minimum = base; double maximum = base; for (int itemNo = 0; itemNo < dataset.getItemCount(); itemNo++) { double positive = base; double negative = base; int seriesCount = dataset.getSeriesCount(); for (int seriesNo = 0; seriesNo < seriesCount; seriesNo++) { double y = dataset.getYValue(seriesNo, itemNo); if (!Double.isNaN(y)) { if (y > 0.0) { positive += y; } else { negative += y; } } } if (positive > maximum) { maximum = positive; } if (negative < minimum) { minimum = negative; } } if (minimum <= maximum) { return new Range(minimum, maximum); } else { return null; } }