Class HistogramSeries
java.lang.Object
com.codename1.ui.chart.Series
com.codename1.ui.chart.series.XYSeries
com.codename1.ui.chart.series.BarSeries
com.codename1.ui.chart.series.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);

-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleThe width of one bin in data units.setSamples(double[] samples, int bins) Bins the samples.Methods inherited from class BarSeries
colorAt, consumesStackBase, getXBounds, getYBounds, hitTest, paint, setBarFraction, setCornerRadiusMethods inherited from class XYSeries
add, add, addRow, animatedAux, animatedBase, animatedY, auxDefault, captureEntryStart, captureTransitionStart, clear, collectTableRows, dataChanged, getAux, getBase, getMinXSpacing, getPoint, getPointCount, getStackGroup, getX, getXBoundsWithin, getY, hasOwnBase, isAscending, isAuxRelative, isCartesian, isGapAt, lowerBound, nearestIndexOfX, nearestScreenIndex, screenPosition, set, setData, setMaxPoints, setRows, setStackGroup, setValues, size, tableValue, targetBase, transitionEnded, visibleRangeMethods inherited from class Series
attached, detached, formatTooltip, formatValue, getChart, getColor, getLegendEntryCount, getLegendEntryName, getName, getSelectablePointCount, getValueFormatter, getVisibilityFraction, handleTap, isGap, isLegendEntryVisible, isPointCountFromLayout, isSecondaryAxis, isShowValues, isVisible, lerp, paintLegendEntrySymbol, paintLegendSymbol, repaintChart, setColor, setName, setSecondaryAxis, setShowValues, setValueFormatter, setVisible, toggleLegendEntry
-
Constructor Details
-
HistogramSeries
Creates an empty histogram.
Parameters
name: the series name
-
-
Method Details
-
setSamples
Bins the samples.
Parameters
-
samples: the raw values;NaNvalues are ignored -
bins: the number of bins, at most 10000, or 0 or less to choose one with Sturges' rule
Returns
this series
Throws
IllegalArgumentException: ifbinsis above 10000, which no chart can show and whose arrays would only exhaust memory
-
-
getBinWidth
public double getBinWidth()The width of one bin in data units.
-