Class LineSeries
java.lang.Object
com.codename1.ui.chart.Series
com.codename1.ui.chart.series.XYSeries
com.codename1.ui.chart.series.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.

-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanTrue 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).intgetMode()The drawing mode.booleanisFilled()True for an area series.voidpaint(ChartContext ctx) Paints the series.setDashed(boolean dashed) Draws a dashed line, for targets and forecasts.setFillAlpha(int alpha) Opacity of the area fill, 0 to 255.setFilled(boolean fill) Fills the area under the line, turning it into an area series; stacked areas need a sharedsetStackGroup.setLineWidth(float mm) Line thickness in millimetres.setMarkers(boolean markers) Draws a dot at every point (skipped automatically when points are too dense to tell apart).setMode(int mode) STRAIGHT,SPLINEorSTEP.Methods inherited from class XYSeries
add, add, addRow, animatedAux, animatedBase, animatedY, auxDefault, captureEntryStart, captureTransitionStart, clear, collectTableRows, dataChanged, getAux, getBase, getMinXSpacing, getPoint, getPointCount, getStackGroup, getX, getXBounds, getXBoundsWithin, getY, getYBounds, hasOwnBase, hitTest, isAscending, isAuxRelative, isCartesian, isGapAt, lowerBound, nearestIndexOfX, nearestScreenIndex, screenPosition, set, setData, setMaxPoints, setRows, setStackGroup, setValues, size, tableValue, targetBase, transitionEnded, visibleRangeMethods inherited from class Series
attached, detached, formatTooltip, 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
-
Field Details
-
STRAIGHT
public static final int STRAIGHTStraight segments between points.- See Also:
-
SPLINE
public static final int SPLINEA monotone cubic curve through the points.- See Also:
-
STEP
public static final int STEPA horizontal run to each point's x, then a vertical step.- See Also:
-
-
Constructor Details
-
LineSeries
Creates an empty line series.
Parameters
name: the legend name
-
-
Method Details
-
setMode
STRAIGHT,SPLINEorSTEP. -
getMode
public int getMode()The drawing mode. -
setFilled
Fills the area under the line, turning it into an area series; stacked areas need a sharedsetStackGroup. -
isFilled
public boolean isFilled()True for an area series. -
setFillAlpha
Opacity of the area fill, 0 to 255. -
setLineWidth
Line thickness in millimetres. -
setMarkers
Draws a dot at every point (skipped automatically when points are too dense to tell apart). -
setDashed
Draws a dashed line, for targets and forecasts. -
consumesStackBase
protected boolean consumesStackBase()Description copied from class:XYSeriesTrue 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).
Returns
false by default
- Overrides:
consumesStackBasein classXYSeries
-
paint
Description copied from class:SeriesPaints the series.
Parameters
ctx: the current frame: graphics, plot area, axes and animation progress
-