/** * Returns the end value for a bin. * * @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 end value. * * @throws IndexOutOfBoundsException if <code>series</code> is outside the * specified range. */ public Number getEndX(int series, int item) { List bins = getBins(series); HistogramBin bin = (HistogramBin) bins.get(item); return new Double(bin.getEndBoundary()); }
/** * Returns the end value for a bin. * * @param series the series index (in the range {@code 0} to * {@code getSeriesCount() - 1}). * @param item the item index (zero based). * * @return The end value. * * @throws IndexOutOfBoundsException if {@code series} is outside the * specified range. */ @Override public Number getEndX(int series, int item) { List bins = getBins(series); HistogramBin bin = (HistogramBin) bins.get(item); return new Double(bin.getEndBoundary()); }
/** * Returns the end value for a bin. * * @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 end value. * * @throws IndexOutOfBoundsException if <code>series</code> is outside the * specified range. */ public Number getEndX(int series, int item) { List bins = getBins(series); HistogramBin bin = (HistogramBin)bins.get(item); return new Double(bin.getEndBoundary()); }
/** * Returns the X value for a bin. This value won't be used for plotting * histograms, since the renderer will ignore it. But other renderers can * use it (for example, you could use the dataset to create a line * chart). * * @param series the series index (in the range {@code 0} to * {@code getSeriesCount() - 1}). * @param item the item index (zero based). * * @return The start value. * * @throws IndexOutOfBoundsException if {@code series} is outside the * specified range. */ @Override public Number getX(int series, int item) { List bins = getBins(series); HistogramBin bin = (HistogramBin) bins.get(item); double x = (bin.getStartBoundary() + bin.getEndBoundary()) / 2.; return new Double(x); }
/** * Returns the X value for a bin. This value won't be used for plotting * histograms, since the renderer will ignore it. But other renderers can * use it (for example, you could use the dataset to create a line * chart). * * @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 start value. * * @throws IndexOutOfBoundsException if <code>series</code> is outside the * specified range. */ public Number getX(int series, int item) { List bins = getBins(series); HistogramBin bin = (HistogramBin)bins.get(item); double x = (bin.getStartBoundary() + bin.getEndBoundary()) / 2D; return new Double(x); }
/** * Returns the X value for a bin. This value won't be used for plotting * histograms, since the renderer will ignore it. But other renderers can * use it (for example, you could use the dataset to create a line * chart). * * @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 start value. * * @throws IndexOutOfBoundsException if <code>series</code> is outside the * specified range. */ public Number getX(int series, int item) { List bins = getBins(series); HistogramBin bin = (HistogramBin) bins.get(item); double x = (bin.getStartBoundary() + bin.getEndBoundary()) / 2.; return new Double(x); }
/** * Synchronize values to bins. Compute bins values. * * @param bins List of bins. * @param values List of values. */ private void synchronizeValuesAndBins(List bins, List values) { ListIterator iterBins = bins.listIterator(0); ListIterator iterValues = values.listIterator(); HistogramBin bin; for (; iterBins.hasNext(); iterBins.set( new HistogramBin(bin.getStartBoundary(), bin.getEndBoundary()))) bin = (HistogramBin)iterBins.next(); iterBins = bins.listIterator(0); while (iterValues.hasNext()) { double currentValue = ((Double)iterValues.next()).doubleValue(); boolean continu = true; iterBins = bins.listIterator(0); while (continu && iterBins.hasNext()) { HistogramBin tempBin = (HistogramBin)iterBins.next(); if (currentValue >= tempBin.getStartBoundary() && currentValue < tempBin.getEndBoundary()) { tempBin.incrementCount(); continu = false; } } } }
double currentMargin; currentBin = (HistogramBin)iter.next(); currentMargin = ((margin*(currentBin.getEndBoundary()-currentBin.getStartBoundary())))*XScale; if ((currentBin.getStartBoundary() >= xmin && currentBin.getStartBoundary() <= xmax) && (currentBin.getCount() >= ymin && currentBin.getCount() <= ymax) ) var = Math.min( currentBin.getEndBoundary(), xmax); if (filled[i]) { formatter.format("\\filldraw [line width=%.2fpt, opacity=%.2f, color=%s] ([xshift=%.4f] %.4f, %.4f) rectangle ([xshift=-%.4f] %.4f, %.4f); %%%n", && (currentBin.getCount() >= ymin && currentBin.getCount() > ymax) ) var = Math.min( currentBin.getEndBoundary(), xmax); if (filled[i]) { formatter.format("\\filldraw [line width=%.2fpt, opacity=%.2f, color=%s] ([xshift=%.4f] %.4f, %.4f) rectangle ([xshift=-%.4f] %.4f, %.4f); %%%n",
double var; newTicks.add(prec.getStartBoundary()); newTicks.add(var = prec.getEndBoundary()); HistogramBin temp; while(binsIter.hasNext()) { if(temp.getStartBoundary() != var) { newTicks.add(var = temp.getStartBoundary()); } else if(temp.getEndBoundary() != var) { newTicks.add(var = temp.getEndBoundary());