Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public class HistogramSeries
A histogram: samples counted into equal width bins and drawn as touching bars.
double[] latencies = {120, 135, 150, 180, 240, 95, 160};
new HistogramSeries("Response time").setSamples(latencies, 0);
Constructors
public HistogramSeries(String name) | Creates an empty histogram. |
Methods
public HistogramSeries setSamples(double[] samples, int bins) | Bins the samples. |
public double getBinWidth() | The width of one bin in data units. |
Inherited methods
From BarSeries
setBarFraction, setCornerRadius, consumesStackBase, getYBounds, getXBounds, paint, colorAt, hitTest
From XYSeries
setRows, addRow, auxDefault, getAux, isCartesian, setData, setValues, add, add, set, clear, setMaxPoints, setStackGroup, getStackGroup, size, getX, getY, getBase, dataChanged, isGapAt, isAscending, nearestIndexOfX, animatedY, animatedAux, isAuxRelative, animatedBase, targetBase, hasOwnBase, captureTransitionStart, transitionEnded, captureEntryStart, getXBoundsWithin, getMinXSpacing, lowerBound, visibleRange, screenPosition, nearestScreenIndex, collectTableRows, tableValue, getPointCount, getPoint
From Series
getName, setName, getColor, setColor, isVisible, setVisible, isSecondaryAxis, setSecondaryAxis, isShowValues, setShowValues, getValueFormatter, setValueFormatter, getChart, getSelectablePointCount, isPointCountFromLayout, paintLegendSymbol, getLegendEntryCount, getLegendEntryName, paintLegendEntrySymbol, isLegendEntryVisible, toggleLegendEntry, formatValue, formatTooltip, handleTap, attached, detached, repaintChart, getVisibilityFraction, isGap, lerp
Constructor details
HistogramSeries
public HistogramSeries(String name)Parameters
nameString- the series name
Method details
setSamples
public HistogramSeries setSamples(double[] samples, int bins)Parameters
samplesdouble[]- the raw values;
NaNvalues are ignored binsint- the number of bins, at most 10000, or 0 or less to choose one with Sturges’ rule
Returns
Throws
IllegalArgumentException- if
binsis above 10000, which no chart can show and whose arrays would only exhaust memory
getBinWidth
public double getBinWidth()