Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public class BarSeries
Known subtypesHistogramSeries, RangeBarSeries, VolumeSeries, WaterfallSeries
Vertical columns, or horizontal bars when the chart is rotated. Several bar series side by side form groups; bar series sharing a stack group stack instead.

Constructors
public BarSeries(String name) | Creates an empty bar series. |
protected BarSeries(String name, int auxChannels) | Creates a bar series that keeps extra values per bar, for range and waterfall bars. |
Methods
public BarSeries setBarFraction(float f) | The share of each category band the bar group fills, 0.1 to 1. |
public BarSeries setCornerRadius(float mm) | The radius of the bar’s outer corners in millimetres; 0 for square bars. |
protected boolean consumesStackBase() | True for a series drawn on its stack base (an area or a bar), which a stack group lifts and whose layer shrinks with the fraction it is shown while it fades; false for marks that keep their own values (scatter, error bars, candles, boxes). |
public double[] getYBounds() | The extent of the data along y, {min, max}, or null when empty or not cartesian. |
public double[] getXBounds() | The extent of the data along x, {min, max}, or null when empty or not cartesian. |
public void paint(ChartContext ctx) | Paints the series. |
protected int colorAt(ChartContext ctx, int i) | The fill colour of bar i; the series colour unless a subclass colours bars by value. |
public ChartPoint hitTest(ChartContext ctx, int x, int y, int radius) | Finds the data point nearest a screen position. |
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, 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
BarSeries
public BarSeries(String name)Parameters
nameString- the legend name
BarSeries
protected BarSeries(String name, int auxChannels)Parameters
nameString- the series name
auxChannelsint- number of extra values per bar
Method details
setBarFraction
public BarSeries setBarFraction(float f)setCornerRadius
public BarSeries setCornerRadius(float mm)consumesStackBase
protected boolean consumesStackBase()Returns
getYBounds
public double[] getYBounds(){min, max}, or null when empty or not cartesian.getXBounds
public double[] getXBounds(){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
colorAt
protected int colorAt(ChartContext ctx, int i)i; the series colour unless a subclass colours bars by value.Parameters
ctxChartContext- the paint context
iint- the bar index
Returns
hitTest
public ChartPoint hitTest(ChartContext ctx, int x, int y, int radius)Parameters
ctxChartContext- the frame the series was last painted in
xint- chart relative x
yint- chart relative y
radiusint- how far from the point a touch may land and still hit it