ChartMarker class
A specialized marker class for displaying various types of markers on a financial chart.
ChartMarker extends the base Marker class to provide additional functionality
for displaying different types of markers on a chart. It represents a specific point
on the chart with additional properties that determine its appearance and behavior.
This class is part of an inheritance hierarchy:
Tick(base class): Provides basic data point functionality with epoch (timestamp) and quote (price).Marker(parent class): ExtendsTickto add direction (up/down) and tap functionality.ChartMarker(this class): ExtendsMarkerto add marker type, text, and color.
ChartMarker objects are typically grouped into MarkerGroup objects, which organize
related markers into logical units (e.g., all markers related to a specific trade or contract).
These marker groups are then rendered on the chart by specialized painter classes.
Constructors
- ChartMarker({required int epoch, required double quote, required MarkerDirection direction, VoidCallback? onTap, MarkerType? markerType, String? text, MarkerTextType textType = MarkerTextType.plain, Color? color, bool hasReducedOpacity = false, Offset displayOffset = Offset.zero})
-
Creates a new
ChartMarkerinstance with the specified properties.
Properties
- close → double
-
Close value (last value in OHLC period)
no setterinherited
- color → Color?
-
The color of the marker.
final
- direction → MarkerDirection
-
Direction in which marker is facing.
finalinherited
- displayOffset → Offset
-
An optional pixel offset applied to the marker's rendered position on the canvas.
final
- epoch → int
-
Epoch of the tick
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasReducedOpacity → bool
-
Whether marker should be rendered with reduced opacity by 50%.
final
- high → double
-
High value (highest value in OHLC period)
no setterinherited
- low → double
-
Low value (lowest value in OHLC period)
no setterinherited
- markerType → MarkerType?
-
The type of marker, which determines its role and how it's rendered on the chart.
final
- onTap → VoidCallback?
-
Called when marker is tapped.
finalinherited
- open → double
-
Open value (first value in OHLC period)
no setterinherited
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setterinherited
- quote → double
-
Tick price
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool?
-
If set to
true, the toString method will be overridden to output this instance's props.no setterinherited - tapArea ↔ Rect
-
Used to store marker tap area on the chart.
getter/setter pairinherited
- text → String?
-
The text to display on or near the marker.
final
- textType → MarkerTextType
-
Controls how text is styled.
final
Methods
-
compareTo(
covariant Marker other) → int -
Compares this object to another object.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited