Skip to content

Type Alias: BaseScatterTrace ​

ts
type BaseScatterTrace = CommonTraceAttributes & CartesianTraceAttributes & object;

Scatter: markers, lines, text labels and filled or stacked areas at x/y positions.

Type Declaration ​

NameTypeDescription
connectgaps?booleanConnect lines across missing (null, NaN) points instead of breaking them.
dx?numberStep between implicit x coordinates (see x0).
dy?numberStep between implicit y coordinates (see y0).
error_x?ScatterTraceErrorXError bars along the x axis.
error_y?ScatterTraceErrorYError bars along the y axis.
fill?| "none" | "tozeroy" | "tozerox" | "tonexty" | "tonextx" | "toself" | "tonext"Area to fill with fillcolor. Default 'none', or 'tonexty' ('tonextx' for orientation: 'h') in a stackgroup. 'tozeroy' / 'tozerox' fill to y = 0 / x = 0; 'tonexty' / 'tonextx' fill to the previous trace on the subplot (in the same stackgroup), joining the end points with straight lines, and act like 'tozero…' without one; 'toself' closes the line (each segment when it has gaps) into a shape; 'tonext' fills between this trace and the previous one when one encloses the other (like 'toself' without one). Fills follow line.shape.
fillcolor?stringFill color. Default: the line color (else the marker color, else the colorway color) at half opacity.
fillgradient?ScatterTraceFillgradientA color gradient drawn instead of fillcolor (which still colors hover labels).
fillpattern?ScatterTraceFillpatternHatch pattern of the area fill (drawn in screen px, for print and grayscale).
groupnorm?"" | "fraction" | "percent"Normalize each position's stackgroup total to 1 ('fraction') or 100 ('percent'). The first trace of the group that sets it decides.
hoveron?"points" | "fills" | "points+fills" | "fills+points"What hover reacts to: points (markers, line vertices) and/or the filled area, which reports the trace. Default 'fills' for 'toself' / 'tonext' fills without markers or text, else 'points'. Fills hover (in every hovermode) only when no point is under the pointer.
line?ScatterTraceLineLine style (mode lines). shape and smoothing also shape fills.
marker?ScatterTraceMarkerMarker style (mode markers).
mode?| "lines" | "markers" | "text" | "lines+markers" | "lines+text" | "markers+lines" | "markers+text" | "text+lines" | "text+markers" | "lines+markers+text" | "lines+text+markers" | "markers+lines+text" | "markers+text+lines" | "text+lines+markers" | "text+markers+lines" | "none"Drawing mode. Defaults to 'lines+markers' below 20 points, else 'lines' (Plotly rule).
orientation?"v" | "h"Stacking direction in a stackgroup: 'v' adds y values, 'h' x values. The first trace of the group that sets it decides; default 'h' when only x is given, else 'v'.
selected?ScatterTraceSelectedStyle of selected points while a selection is active (box/lasso select, selectedpoints).
stackgaps?"infer zero" | "interpolate"What a stackgroup trace contributes where other traces of the group have a position it lacks (or where its value is missing): zero, or a value interpolated linearly between its neighbors (constant beyond its ends). The first trace of the group that sets it decides.
stackgroup?stringStack this trace on the previous traces of the same group on its subplot: their y values add up (x values for orientation: 'h'). Stacking turns fill on ('tonexty' / 'tonextx') and makes mode default to 'lines'. Only numeric (linear or log) value axes stack.
text?PerPoint<string | number>Text per point: the labels of mode text, and hover text.
textfont?ScatterTraceTextfontFont of the text labels (mode text). Defaults to layout.font.
textposition?PerPoint< | "top left" | "top center" | "top right" | "middle left" | "middle center" | "middle right" | "bottom left" | "bottom center" | "bottom right">Where text labels sit relative to their point (and marker), or one per point.
texttemplate?PerPoint<string | number>Template for the text labels, e.g. '%{y:.2f}' or `'%{x
type?"scatter"Trace type (the default: a trace without type is a scatter trace).
unselected?ScatterTraceUnselectedStyle of unselected points while a selection is active (box/lasso select, selectedpoints).
x?DataColumnx coordinates: numbers, dates or category names depending on the axis type.
x0?unknownStarting x coordinate when x is not given: point i is at x0 + i·dx.
xperiod?unknownOnly on date or linear x axes: snap each x value to its period of this length (ms, or 'M<n>' months on date axes), positioned per xperiodalignment.
xperiod0?unknownA period boundary for xperiod. Default: 2000-01-01 on date axes (a Sunday for weekly periods), 0 otherwise.
xperiodalignment?"start" | "middle" | "end"Where points sit within their xperiod.
y?DataColumny coordinates: numbers, dates or category names depending on the axis type.
y0?unknownStarting y coordinate when y is not given: point i is at y0 + i·dy.
yperiod?unknownOnly on date or linear y axes: snap each y value to its period of this length (ms, or 'M<n>' months on date axes), positioned per yperiodalignment.
yperiod0?unknownA period boundary for yperiod. Default: 2000-01-01 on date axes (a Sunday for weekly periods), 0 otherwise.
yperiodalignment?"start" | "middle" | "end"Where points sit within their yperiod.
zorder?numberStacking order among the traces of a subplot: higher is drawn on top. At equal zorder, scatter traces draw above bars (Plotly’s layer order), then in trace order.

Released under the MIT License.