LineSeries class
Configuration of one line series.
Data can be supplied inline via data (static charts) or fed through the
chart controller (setSeriesData/appendPoints/prependPoints and lazy
loading) when data is null.
- Inheritance
-
- Object
- ChartSeries
- LineSeries
- Annotations
Constructors
-
LineSeries({required String id, List<
ChartPoint> ? data, Color color = const Color(0xFF2196F3), ChartColorScale? colorScale, double strokeWidth = 2.0, StrokeCap strokeCap = StrokeCap.round, PointMarker? marker, PointMarker? endMarker, GapPolicy gapPolicy = GapPolicy.break_, LineCurve curve = LineCurve.straight, LineSeriesFill? fill, List<double> ? dashArray, Gradient? strokeGradient}) -
const
Properties
- color → Color
-
Stroke color when no colorScale is set.
final
- colorScale → ChartColorScale?
-
Value-dependent stroke coloring (overrides color); see
ChartColorScale.
final
- curve → LineCurve
-
How points are connected; LineCurve.straight by default.
final
-
dashArray
→ List<
double> ? -
Stroke dash pattern (on/off pixel lengths, cycled); null (default) = solid.
Applies only to the stroke, not the fill. See
dashPath.final -
data
→ List<
ChartPoint> ? -
Inline data; kept in x-ascending order internally. Null when data is fed
through the controller (live/lazy charts).
finalinherited
- endMarker → PointMarker?
-
Marker drawn ONLY at the last non-gap point (e.g. an endpoint badge);
null (default) = none. Independent of marker (which draws on every point).
final
- fill → LineSeriesFill?
-
Optional below-line area fill; null (default) paints no fill.
final
- gapPolicy → GapPolicy
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
Identifies the series in the controller's data store.
finalinherited
- marker → PointMarker?
-
Marker drawn on every non-gap data point.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- strokeCap → StrokeCap
-
final
- strokeGradient → Gradient?
-
Position-space stroke gradient, mapped over the series' non-gap spot
bounding box. Overrides colorScale/color.
Null (default) = none. See
boundsOf.final - strokeWidth → double
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
paint(
ChartPaintContext context, SeriesRenderSnapshot snapshot) → void -
Paints the series' visible slice, after behind-series decorations and
before above-series decorations, in the order series are listed. May
publish paint products on
snapshot(see SeriesRenderSnapshot.geometry) for decorations painted above.override -
paintOutsidePlot(
ChartPaintContext context, SeriesRenderSnapshot snapshot) → void -
A second paint pass, running after every series and decoration has
painted — e.g. an endpoint badge that must sit above other series, not
just above its own. Default: nothing.
override
-
pixelOverhang(
ResolvedAxis xAxis) → double -
Extra horizontal reach of this series' marks beyond their x value, in
pixels. A point-like series (a line) reaches 0; a wide mark (a bar)
reaches half its width plus any horizontal offset. The chart widens the
visible data slice by this much (converted to domain units through the
x axis) so an edge mark stays painted while scrolling instead of popping
in and out when its anchor crosses the viewport edge.
inherited
-
snap(
SnapContext context) → SnappedPoint? -
The point this series snaps to for a pointer at SnapContext.pixelX —
what the trackball pins and hit callbacks report. Null opts the series
out of the query.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
trackballMarkerColor(
ChartPoint point) → Color? -
Color for the default trackball marker snapped to
point; null usesTrackballBehavior.lineColor. Default: null.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited