Java Code Examples for org.jfree.data.xy.TableXYDataset#getYValue()
The following examples show how to use
org.jfree.data.xy.TableXYDataset#getYValue() .
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 ECG-Viewer with GNU General Public License v2.0 | 6 votes |
/** * Calculates the stacked values (one positive and one negative) of all * series up to, but not including, <code>series</code> for the specified * item. It returns [0.0, 0.0] if <code>series</code> is the first series. * * @param dataset the dataset (<code>null</code> not permitted). * @param series the series index. * @param index the item index. * * @return An array containing the cumulative negative and positive values * for all series values up to but excluding <code>series</code> * for <code>index</code>. */ private double[] getStackValues(TableXYDataset dataset, int series, int index) { double[] result = new double[2]; for (int i = 0; i < series; i++) { double v = dataset.getYValue(i, index); if (!Double.isNaN(v)) { if (v >= 0.0) { result[1] += v; } else { result[0] += v; } } } return result; }
Example 2
Source File: StackedXYAreaRenderer2.java From ccu-historian with GNU General Public License v3.0 | 6 votes |
/** * Calculates the stacked values (one positive and one negative) of all * series up to, but not including, <code>series</code> for the specified * item. It returns [0.0, 0.0] if <code>series</code> is the first series. * * @param dataset the dataset (<code>null</code> not permitted). * @param series the series index. * @param index the item index. * * @return An array containing the cumulative negative and positive values * for all series values up to but excluding <code>series</code> * for <code>index</code>. */ private double[] getStackValues(TableXYDataset dataset, int series, int index) { double[] result = new double[2]; for (int i = 0; i < series; i++) { double v = dataset.getYValue(i, index); if (!Double.isNaN(v)) { if (v >= 0.0) { result[1] += v; } else { result[0] += v; } } } return result; }
Example 3
Source File: StackedXYAreaRenderer2.java From SIMVA-SoS with Apache License 2.0 | 6 votes |
/** * Calculates the stacked values (one positive and one negative) of all * series up to, but not including, <code>series</code> for the specified * item. It returns [0.0, 0.0] if <code>series</code> is the first series. * * @param dataset the dataset (<code>null</code> not permitted). * @param series the series index. * @param index the item index. * * @return An array containing the cumulative negative and positive values * for all series values up to but excluding <code>series</code> * for <code>index</code>. */ private double[] getStackValues(TableXYDataset dataset, int series, int index) { double[] result = new double[2]; for (int i = 0; i < series; i++) { double v = dataset.getYValue(i, index); if (!Double.isNaN(v)) { if (v >= 0.0) { result[1] += v; } else { result[0] += v; } } } return result; }
Example 4
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 5
Source File: Cardumen_00194_s.java From coming with MIT License | 5 votes |
/** * Calculates the total for the y-values in all series for a given item * index. * * @param dataset the dataset. * @param item the item index. * * @return The total. * * @since 1.0.5 */ public static double calculateStackTotal(TableXYDataset dataset, int item) { double total = 0.0; int seriesCount = dataset.getSeriesCount(); for (int s = 0; s < seriesCount; s++) { double value = dataset.getYValue(s, item); if (!Double.isNaN(value)) { total = total + value; } } return total; }
Example 6
Source File: Cardumen_00194_t.java From coming with MIT License | 5 votes |
/** * Calculates the total for the y-values in all series for a given item * index. * * @param dataset the dataset. * @param item the item index. * * @return The total. * * @since 1.0.5 */ public static double calculateStackTotal(TableXYDataset dataset, int item) { double total = 0.0; int seriesCount = dataset.getSeriesCount(); for (int s = 0; s < seriesCount; s++) { double value = dataset.getYValue(s, item); if (!Double.isNaN(value)) { total = total + value; } } return total; }
Example 7
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 8
Source File: Cardumen_0079_t.java From coming with MIT License | 5 votes |
/** * Calculates the total for the y-values in all series for a given item * index. * * @param dataset the dataset. * @param item the item index. * * @return The total. * * @since 1.0.5 */ public static double calculateStackTotal(TableXYDataset dataset, int item) { double total = 0.0; int seriesCount = dataset.getSeriesCount(); for (int s = 0; s < seriesCount; s++) { double value = dataset.getYValue(s, item); if (!Double.isNaN(value)) { total = total + value; } } return total; }
Example 9
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 10
Source File: Cardumen_0079_s.java From coming with MIT License | 5 votes |
/** * Calculates the total for the y-values in all series for a given item * index. * * @param dataset the dataset. * @param item the item index. * * @return The total. * * @since 1.0.5 */ public static double calculateStackTotal(TableXYDataset dataset, int item) { double total = 0.0; int seriesCount = dataset.getSeriesCount(); for (int s = 0; s < seriesCount; s++) { double value = dataset.getYValue(s, item); if (!Double.isNaN(value)) { total = total + value; } } return total; }
Example 11
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 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: DatasetUtilities.java From ECG-Viewer with GNU General Public License v2.0 | 5 votes |
/** * Calculates the total for the y-values in all series for a given item * index. * * @param dataset the dataset. * @param item the item index. * * @return The total. * * @since 1.0.5 */ public static double calculateStackTotal(TableXYDataset dataset, int item) { double total = 0.0; int seriesCount = dataset.getSeriesCount(); for (int s = 0; s < seriesCount; s++) { double value = dataset.getYValue(s, item); if (!Double.isNaN(value)) { total = total + value; } } return total; }
Example 14
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 15
Source File: DatasetUtilities.java From openstock with GNU General Public License v3.0 | 5 votes |
/** * Calculates the total for the y-values in all series for a given item * index. * * @param dataset the dataset. * @param item the item index. * * @return The total. * * @since 1.0.5 */ public static double calculateStackTotal(TableXYDataset dataset, int item) { double total = 0.0; int seriesCount = dataset.getSeriesCount(); for (int s = 0; s < seriesCount; s++) { double value = dataset.getYValue(s, item); if (!Double.isNaN(value)) { total = total + value; } } return total; }
Example 16
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 17
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 18
Source File: StackedXYAreaRenderer.java From SIMVA-SoS with Apache License 2.0 | 3 votes |
/** * Calculates the stacked value of the all series up to, but not including * <code>series</code> for the specified item. It returns 0.0 if * <code>series</code> is the first series, i.e. 0. * * @param dataset the dataset. * @param series the series. * @param index the index. * * @return The cumulative value for all series' values up to but excluding * <code>series</code> for <code>index</code>. */ protected double getPreviousHeight(TableXYDataset dataset, int series, int index) { double result = 0.0; for (int i = 0; i < series; i++) { double value = dataset.getYValue(i, index); if (!Double.isNaN(value)) { result += value; } } return result; }
Example 19
Source File: StackedXYAreaRenderer.java From opensim-gui with Apache License 2.0 | 3 votes |
/** * Calculates the stacked value of the all series up to, but not including * <code>series</code> for the specified item. It returns 0.0 if * <code>series</code> is the first series, i.e. 0. * * @param dataset the dataset. * @param series the series. * @param index the index. * * @return The cumulative value for all series' values up to but excluding * <code>series</code> for <code>index</code>. */ protected double getPreviousHeight(TableXYDataset dataset, int series, int index) { double result = 0.0; for (int i = 0; i < series; i++) { double value = dataset.getYValue(i, index); if (!Double.isNaN(value)) { result += value; } } return result; }
Example 20
Source File: StackedXYAreaRenderer.java From astor with GNU General Public License v2.0 | 3 votes |
/** * Calculates the stacked value of the all series up to, but not including * <code>series</code> for the specified item. It returns 0.0 if * <code>series</code> is the first series, i.e. 0. * * @param dataset the dataset. * @param series the series. * @param index the index. * * @return The cumulative value for all series' values up to but excluding * <code>series</code> for <code>index</code>. */ protected double getPreviousHeight(TableXYDataset dataset, int series, int index) { double result = 0.0; for (int i = 0; i < series; i++) { double value = dataset.getYValue(i, index); if (!Double.isNaN(value)) { result += value; } } return result; }