@Test public void testGetMinMaxY() { System.out.println("getMinMaxY"); int maxPoints = 0; AbstractGraphRow instance = new AbstractGraphRowImpl(); double[] result = instance.getMinMaxY(maxPoints); Assert.assertNotNull(result); }
public double[] getMinMaxY(int maxPoints) { int factor; double[] minMax = new double[2]; minMax[0] = Double.MAX_VALUE; minMax[1] = 0; Entry<Long, AbstractGraphPanelChartElement> element; if (maxPoints > 0) { factor = (int) Math.floor(this.size() / (double) maxPoints) + 1; } else { factor = 1; } Iterator<Entry<Long, AbstractGraphPanelChartElement>> it = this.iterator(); double calcY; while (it.hasNext()) { calcY = 0; if (factor == 1) { element = it.next(); AbstractGraphPanelChartElement elt = element.getValue(); calcY = elt.getValue(); } else { double nbPointProcessed = 0; for (int i = 0; i < factor; i++) { if (it.hasNext()) { element = it.next(); calcY = calcY + element.getValue().getValue(); nbPointProcessed++; } } calcY = calcY / nbPointProcessed; } if (minMax[0] > calcY) { minMax[0] = calcY; } if (minMax[1] < calcY) { minMax[1] = calcY; } } if (isDrawBar()) { minMax[0] = 0; } return minMax; }
AbstractGraphRow { public double[] getMinMaxY(int maxPoints) { int factor; double[] minMax = new double[2]; minMax[0] = Double.MAX_VALUE; minMax[1] = 0; Entry<Long, AbstractGraphPanelChartElement> element; if (maxPoints > 0) { factor = (int) Math.floor(this.size() / (double) maxPoints) + 1; } else { factor = 1; } Iterator<Entry<Long, AbstractGraphPanelChartElement>> it = this.iterator(); double calcY; while (it.hasNext()) { calcY = 0; if (factor == 1) { element = it.next(); AbstractGraphPanelChartElement elt = element.getValue(); calcY = elt.getValue(); } else { double nbPointProcessed = 0; for (int i = 0; i < factor; i++) { if (it.hasNext()) { element = it.next(); calcY = calcY + element.getValue().getValue(); nbPointProcessed++; } } calcY = calcY / nbPointProcessed; } if (minMax[0] > calcY) { minMax[0] = calcY; } if (minMax[1] < calcY) { minMax[1] = calcY; } } if (isDrawBar()) { minMax[0] = 0; } return minMax; } }
AbstractGraphRow { public double[] getMinMaxY(int maxPoints) { int factor; double[] minMax = new double[2]; minMax[0] = Double.MAX_VALUE; minMax[1] = 0; Entry<Long, AbstractGraphPanelChartElement> element; if (maxPoints > 0) { factor = (int) Math.floor(this.size() / (double) maxPoints) + 1; } else { factor = 1; } Iterator<Entry<Long, AbstractGraphPanelChartElement>> it = this.iterator(); double calcY; while (it.hasNext()) { calcY = 0; if (factor == 1) { element = it.next(); AbstractGraphPanelChartElement elt = element.getValue(); calcY = elt.getValue(); } else { double nbPointProcessed = 0; for (int i = 0; i < factor; i++) { if (it.hasNext()) { element = it.next(); calcY = calcY + element.getValue().getValue(); nbPointProcessed++; } } calcY = calcY / nbPointProcessed; } if (minMax[0] > calcY) { minMax[0] = calcY; } if (minMax[1] < calcY) { minMax[1] = calcY; } } if (isDrawBar()) { minMax[0] = 0; } return minMax; }  }
AbstractGraphRow { public double[] getMinMaxY(int maxPoints) { int factor; double[] minMax = new double[2]; minMax[0] = Double.MAX_VALUE; minMax[1] = 0; Entry<Long, AbstractGraphPanelChartElement> element; if (maxPoints > 0) { factor = (int) Math.floor(this.size() / (double) maxPoints) + 1; } else { factor = 1; } Iterator<Entry<Long, AbstractGraphPanelChartElement>> it = this.iterator(); double calcY; while (it.hasNext()) { calcY = 0; if (factor == 1) { element = it.next(); AbstractGraphPanelChartElement elt = element.getValue(); calcY = elt.getValue(); } else { double nbPointProcessed = 0; for (int i = 0; i < factor; i++) { if (it.hasNext()) { element = it.next(); calcY = calcY + element.getValue().getValue(); nbPointProcessed++; } } calcY = calcY / nbPointProcessed; } if (minMax[0] > calcY) { minMax[0] = calcY; } if (minMax[1] < calcY) { minMax[1] = calcY; } } if (isDrawBar()) { minMax[0] = 0; } return minMax; }  void setDrawThickLines(boolean isThickLine); boolean isDrawThickLines(); void setDrawLine(boolean b); void setMarkerSize(int aMarkerSize); boolean isDrawLine(); int getMarkerSize(); Color getColor(); void setColor(Color nextColor); String getLabel(); void setLabel(String label); long getMaxX(); double[] getMinMaxY(int maxPoints); long getMinX(); void add(long xVal, double yVal); abstract Iterator<Entry<Long, AbstractGraphPanelChartElement>> iterator(); boolean isDrawValueLabel(); void setDrawValueLabel(boolean drawValueLabel); boolean isShowInLegend(); void setShowInLegend(boolean showInLegend); boolean isDrawOnChart(); void setDrawOnChart(boolean drawOnChart); void setDrawBar(boolean b); boolean isDrawBar(); boolean isDrawSpline(); void setDrawSpline(boolean drawSpline); int getGranulationValue(); void setGranulationValue(int value); void setExcludeOutOfRangeValues(boolean excludeOutOfRangeValues); abstract AbstractGraphPanelChartElement getElement(long value); AbstractGraphPanelChartElement getLowerElement(long value); Long getHigherKey(long value); abstract int size(); static AbstractGraphRow instantiateNewRow(int rowType); long getFirstTime(); void setLegendColorBox(Rectangle val); Rectangle getLegendColorBox(); }
AbstractGraphRow { public double[] getMinMaxY(int maxPoints) { int factor; double[] minMax = new double[2]; minMax[0] = Double.MAX_VALUE; minMax[1] = 0; Entry<Long, AbstractGraphPanelChartElement> element; if (maxPoints > 0) { factor = (int) Math.floor(this.size() / (double) maxPoints) + 1; } else { factor = 1; } Iterator<Entry<Long, AbstractGraphPanelChartElement>> it = this.iterator(); double calcY; while (it.hasNext()) { calcY = 0; if (factor == 1) { element = it.next(); AbstractGraphPanelChartElement elt = element.getValue(); calcY = elt.getValue(); } else { double nbPointProcessed = 0; for (int i = 0; i < factor; i++) { if (it.hasNext()) { element = it.next(); calcY = calcY + element.getValue().getValue(); nbPointProcessed++; } } calcY = calcY / nbPointProcessed; } if (minMax[0] > calcY) { minMax[0] = calcY; } if (minMax[1] < calcY) { minMax[1] = calcY; } } if (isDrawBar()) { minMax[0] = 0; } return minMax; }  void setDrawThickLines(boolean isThickLine); boolean isDrawThickLines(); void setDrawLine(boolean b); void setMarkerSize(int aMarkerSize); boolean isDrawLine(); int getMarkerSize(); Color getColor(); void setColor(Color nextColor); String getLabel(); void setLabel(String label); long getMaxX(); double[] getMinMaxY(int maxPoints); long getMinX(); void add(long xVal, double yVal); abstract Iterator<Entry<Long, AbstractGraphPanelChartElement>> iterator(); boolean isDrawValueLabel(); void setDrawValueLabel(boolean drawValueLabel); boolean isShowInLegend(); void setShowInLegend(boolean showInLegend); boolean isDrawOnChart(); void setDrawOnChart(boolean drawOnChart); void setDrawBar(boolean b); boolean isDrawBar(); boolean isDrawSpline(); void setDrawSpline(boolean drawSpline); int getGranulationValue(); void setGranulationValue(int value); void setExcludeOutOfRangeValues(boolean excludeOutOfRangeValues); abstract AbstractGraphPanelChartElement getElement(long value); AbstractGraphPanelChartElement getLowerElement(long value); Long getHigherKey(long value); abstract int size(); static AbstractGraphRow instantiateNewRow(int rowType); long getFirstTime(); void setLegendColorBox(Rectangle val); Rectangle getLegendColorBox(); static final int MARKER_SIZE_NONE; static final int MARKER_SIZE_SMALL; static final int MARKER_SIZE_BIG; static final float LINE_THICKNESS_BIG; static final int ROW_AVERAGES; static final int ROW_EXACT_VALUES; static final int ROW_OVERALL_AVERAGES; static final int ROW_PERCENTILES; static final int ROW_SUM_VALUES; static final int ROW_ROLLING_SUM_VALUES; static final int ROW_SIMPLE; }