Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public class ErrorBarSeries
Values with an uncertainty interval, drawn as a marker with whiskers. Layer it over a bar or line series of the same values to add error bars to them.
double[] mean = {5, 7, 6}, low = {4, 6, 4.5}, high = {6, 8.5, 7};
new ErrorBarSeries("Mean").setIntervals(null, mean, low, high);
Constructors
public ErrorBarSeries(String name) | Creates an empty series. |
Methods
public ErrorBarSeries setIntervals(double[] x, double[] value, double[] low, double[] high) | Replaces all values. |
public ErrorBarSeries setMarkers(boolean m) | Shows or hides the marker at the central value, for overlaying on bars. |
public double getLow(int i) | The lower end of interval i. |
public double getHigh(int i) | The upper end of interval i. |
public double[] getYBounds() | The extent of the data along y, {min, max}, or null when empty or not cartesian. |
public void paint(ChartContext ctx) | Paints the series. |
public String formatTooltip(ChartContext ctx, ChartPoint p) | The tooltip row for a point: the series or point name and its formatted value. |
protected String tableValue(int i) | The text of point i in the accessible data table. |
Inherited methods
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, consumesStackBase, animatedAux, isAuxRelative, animatedBase, targetBase, hasOwnBase, captureTransitionStart, transitionEnded, captureEntryStart, getXBounds, getXBoundsWithin, getMinXSpacing, lowerBound, visibleRange, screenPosition, nearestScreenIndex, hitTest, collectTableRows, 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, handleTap, attached, detached, repaintChart, getVisibilityFraction, isGap, lerp
Constructor details
ErrorBarSeries
public ErrorBarSeries(String name)Parameters
nameString- the series name
Method details
setIntervals
public ErrorBarSeries setIntervals(double[] x, double[] value, double[] low, double[] high)Parameters
xdouble[]- x values, or null for 0, 1, 2…
valuedouble[]- the central values
lowdouble[]- the lower end of each interval
highdouble[]- the upper end of each interval
Returns
setMarkers
public ErrorBarSeries setMarkers(boolean m)Parameters
mboolean- true to draw markers
Returns
getLow
public double getLow(int i)i.getHigh
public double getHigh(int i)i.getYBounds
public double[] getYBounds(){min, max}, or null when empty or not cartesian.paint
public void paint(ChartContext ctx)Parameters
ctxChartContext- the current frame: graphics, plot area, axes and animation progress
formatTooltip
public String formatTooltip(ChartContext ctx, ChartPoint p)Parameters
ctxChartContext- the last paint context
pChartPoint- the point
Returns
tableValue
protected String tableValue(int i)i in the accessible data table.Parameters
iint- the point index