Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public class HistogramSeries

  1. Object
  2. Series
  3. XYSeries
  4. BarSeries
  5. 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);

A histogram

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

Constructor details

HistogramSeries

public HistogramSeries(String name)
Creates an empty histogram.

Parameters

name String
the series name

Method details

setSamples

public HistogramSeries setSamples(double[] samples, int bins)
Bins the samples.

Parameters

samples double[]
the raw values; NaN values are ignored
bins int
the number of bins, at most 10000, or 0 or less to choose one with Sturges’ rule

Returns

this series

Throws

IllegalArgumentException
if bins is 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.