Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public class LineSeries
A line, spline, step or area series.
Splines are monotone cubic curves: they pass through every point and never overshoot between two of them, so a smoothed line cannot invent a peak the data does not have. Dense data is reduced to the minimum and maximum of each pixel column before drawing, which keeps every spike while painting a constant number of segments.

Fields
public static final int STRAIGHT = 0 | Straight segments between points. |
public static final int SPLINE = 1 | A monotone cubic curve through the points. |
public static final int STEP = 2 | A horizontal run to each point’s x, then a vertical step. |
Constructors
public LineSeries(String name) | Creates an empty line series. |
Methods
public LineSeries setMode(int mode) | STRAIGHT, SPLINE or STEP. |
public int getMode() | The drawing mode. |
public LineSeries setFilled(boolean fill) | Fills the area under the line, turning it into an area series; stacked areas need a shared setStackGroup. |
public boolean isFilled() | True for an area series. |
public LineSeries setFillAlpha(int alpha) | Opacity of the area fill, 0 to 255. |
public LineSeries setLineWidth(float mm) | Line thickness in millimetres. |
public LineSeries setMarkers(boolean markers) | Draws a dot at every point (skipped automatically when points are too dense to tell apart). |
public LineSeries setDashed(boolean dashed) | Draws a dashed line, for targets and forecasts. |
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 void paint(ChartContext ctx) | Paints the series. |
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, getXBounds, getXBoundsWithin, getYBounds, getMinXSpacing, lowerBound, visibleRange, screenPosition, nearestScreenIndex, hitTest, 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
Field details
STRAIGHT
public static final int STRAIGHT = 0SPLINE
public static final int SPLINE = 1STEP
public static final int STEP = 2Constructor details
LineSeries
public LineSeries(String name)Parameters
nameString- the legend name
Method details
setMode
public LineSeries setMode(int mode)STRAIGHT, SPLINE or STEP.getMode
public int getMode()setFilled
public LineSeries setFilled(boolean fill)setStackGroup.isFilled
public boolean isFilled()setFillAlpha
public LineSeries setFillAlpha(int alpha)setLineWidth
public LineSeries setLineWidth(float mm)setMarkers
public LineSeries setMarkers(boolean markers)setDashed
public LineSeries setDashed(boolean dashed)consumesStackBase
protected boolean consumesStackBase()Returns
paint
public void paint(ChartContext ctx)Parameters
ctxChartContext- the current frame: graphics, plot area, axes and animation progress