/** * Returns the y-value for a bin (calculated to take into account the * histogram type). * * @param series the series index (in the range <code>0</code> to * <code>getSeriesCount() - 1</code>). * @param item the item index (zero based). * * @return The y-value. * * @throws IndexOutOfBoundsException if <code>series</code> is outside the * specified range. */ public Number getY(int series, int item) { List bins = getBins(series); HistogramBin bin = (HistogramBin)bins.get(item); double total = getTotal(series); double binWidth = getBinWidth(series); if (type == HistogramType.FREQUENCY) return new Double(bin.getCount()); if (type == HistogramType.RELATIVE_FREQUENCY) return new Double((double)bin.getCount() / total); if (type == HistogramType.SCALE_AREA_TO_1) return new Double((double)bin.getCount() / (binWidth * total)); else throw new IllegalStateException(); }
currentMargin = ((margin*(currentBin.getEndBoundary()-currentBin.getStartBoundary())))*XScale; if ((currentBin.getStartBoundary() >= xmin && currentBin.getStartBoundary() <= xmax) && (currentBin.getCount() >= ymin && currentBin.getCount() <= ymax) ) lineWidth[i], (color.getAlpha()/255.0), colorString, currentMargin, (currentBin.getStartBoundary()-XShift)*XScale, 0.0, currentMargin, (var-XShift)*XScale, (currentBin.getCount()-YShift)*YScale); lineWidth[i], colorString, currentMargin, (currentBin.getStartBoundary()-XShift)*XScale, 0.0, currentMargin, (var-XShift)*XScale, (currentBin.getCount()-YShift)*YScale); && (currentBin.getCount() >= ymin && currentBin.getCount() > ymax) )