Class BoxPlotSeries
Box and whisker plots: the median, the interquartile box and the whiskers of each group.
Give it the five numbers directly or let it compute them from raw samples:
double[] mondaySamples = {120, 135, 150, 180, 240};
double[] tuesdaySamples = {110, 125, 140, 160, 300};
BoxPlotSeries s = new BoxPlotSeries("Latency");
s.addSamples(0, mondaySamples);
s.addSamples(1, tuesdaySamples);

-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddBox(double x, double min, double q1, double median, double q3, double max) Appends a box from its five numbers.addSamples(double x, double[] samples) Appends a box computed from raw samples.protected voidForgets the outliers of boxes that are no longer in the series, such as one a slide dropped; they are dropped when the outliers are next read.formatTooltip(ChartContext ctx, ChartPoint p) The tooltip row for a point: the series or point name and its formatted value.doublegetMax(int i) The upper whisker of boxi.doublegetMin(int i) The lower whisker of boxi.double[]getOutliers(int i) The outliers of boxi: the samplesaddSamplesplaced beyond the whiskers.double[]The extent of the data along x,{min, max}, or null when empty or not cartesian.double[]The extent of the data along y,{min, max}, or null when empty or not cartesian.voidpaint(ChartContext ctx) Paints the series.static doublequantile(double[] sorted, double q) Linear interpolated quantile of sorted data.setBoxFraction(float f) The fraction of each slot a box takes.protected StringtableValue(int i) The text of pointiin the accessible data table.Methods inherited from class XYSeries
add, add, addRow, animatedAux, animatedBase, animatedY, auxDefault, captureEntryStart, captureTransitionStart, clear, collectTableRows, consumesStackBase, getAux, getBase, getMinXSpacing, getPoint, getPointCount, getStackGroup, getX, getXBoundsWithin, getY, hasOwnBase, hitTest, isAscending, isAuxRelative, isCartesian, isGapAt, lowerBound, nearestIndexOfX, nearestScreenIndex, screenPosition, set, setData, setMaxPoints, setRows, setStackGroup, setValues, size, targetBase, transitionEnded, visibleRangeMethods inherited from class Series
attached, detached, 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
-
BoxPlotSeries
Creates an empty series.
Parameters
name: the series name
-
-
Method Details
-
addBox
Appends a box from its five numbers.
Parameters
-
x: the group's x value -
min: the lower whisker -
q1: the first quartile -
median: the median -
q3: the third quartile -
max: the upper whisker
Returns
this series
-
-
addSamples
Appends a box computed from raw samples. The whiskers reach the furthest samples within 1.5 times the interquartile range of the box (Tukey's rule) and every sample beyond them is an outlier, drawn as a dot and returned by
getOutliers(int).Parameters
-
x: the group's x value -
samples: the values; the array is not modified
Returns
this series
-
-
getOutliers
public double[] getOutliers(int i) The outliers of box
i: the samplesaddSamplesplaced beyond the whiskers. A box given byaddBoxhas none.Parameters
i: the box index
Returns
a new array, empty when there are none
-
getMin
public double getMin(int i) The lower whisker of box
i.Parameters
i: the box index
Returns
the lower whisker's value
-
getMax
public double getMax(int i) The upper whisker of box
i.Parameters
i: the box index
Returns
the upper whisker's value
-
dataChanged
protected void dataChanged()Forgets the outliers of boxes that are no longer in the series, such as one a slide dropped; they are dropped when the outliers are next read.- Overrides:
dataChangedin classXYSeries
-
quantile
public static double quantile(double[] sorted, double q) Linear interpolated quantile of sorted data.
Parameters
-
sorted: ascending values -
q: the quantile, 0 to 1
Returns
the quantile
-
-
setBoxFraction
The fraction of each slot a box takes.
Parameters
f: 0.1 to 1
Returns
this series
-
getYBounds
public double[] getYBounds()Description copied from class:SeriesThe extent of the data along y,{min, max}, or null when empty or not cartesian.- Overrides:
getYBoundsin classXYSeries
-
getXBounds
public double[] getXBounds()Description copied from class:SeriesThe extent of the data along x,{min, max}, or null when empty or not cartesian.- Overrides:
getXBoundsin classXYSeries
-
paint
Description copied from class:SeriesPaints the series.
Parameters
ctx: the current frame: graphics, plot area, axes and animation progress
-
formatTooltip
Description copied from class:SeriesThe tooltip row for a point: the series or point name and its formatted value. Series with several values per point (open/high/low/close, ranges, box plots) override this.
Parameters
-
ctx: the last paint context -
p: the point
Returns
one line of text
- Overrides:
formatTooltipin classSeries
-
-
tableValue
Description copied from class:XYSeriesThe text of point
iin the accessible data table.Parameters
i: the point index
Returns
the formatted value
- Overrides:
tableValuein classXYSeries
-