TradeRatioDrawingToolConfig class
Trade ratio drawing tool config.
Anchors two points defining a base price span, then projects a set of
percentage levels of that span as horizontal lines across the chart,
matching ChartIQ's retracement tool: 0% sits at the start anchor (the
entry), positive percentages extend past the start anchor away from the
end anchor (e.g. 100% is one full span beyond the start, on the opposite
side from the end anchor), and negative percentages extend past the end
anchor instead, continuing in the same direction as the start->end move.
- Inheritance
-
- Object
- AddOnConfig
- DrawingToolConfig
- TradeRatioDrawingToolConfig
- Annotations
-
- @JsonSerializable.new()
Constructors
-
TradeRatioDrawingToolConfig({String? configId, DrawingData? drawingData, List<
EdgePoint> edgePoints = const <EdgePoint>[], LineStyle fillStyle = const LineStyle(thickness: 0.9, color: Colors.blue), LineStyle lineStyle = const LineStyle(thickness: 0.9, color: Colors.blue), DrawingPatterns pattern = DrawingPatterns.solid, List<double> levels = defaultTradeRatioLevels, List<Color> levelColors = defaultTradeRatioLevelColors, TextStyle labelStyle = const TextStyle(fontSize: 11), bool extendLeft = false, int? farXEpochOffset, int number = 0}) -
Initializes
const
-
TradeRatioDrawingToolConfig.fromJson(Map<
String, dynamic> json) -
Initializes from JSON.
factory
Properties
- configId → String?
-
Drawing tool config id.
finalinherited
- drawingData → DrawingData?
-
Drawing tool data.
finalinherited
-
edgePoints
→ List<
EdgePoint> -
Drawing tool edge points.
finalinherited
- extendLeft → bool
-
Whether level lines are pinned to the chart's left edge instead of
starting where they cross the (possibly extrapolated) diagonal anchor
line.
final
- farXEpochOffset → int?
-
How far (in epoch milliseconds) past the start anchor's epoch the
level lines' shared far (right) edge sits, once the user has dragged
the far-edge handle.
nullmeans "use the default, modest on-screen width" (the default, before any dragging).final - fillStyle → LineStyle
-
Unused by this tool; kept for parity with the shared
copyWithsurface other drawing tools use.final - hashCode → int
-
The hash code for this object.
no setterinherited
- isOverlay → bool
-
Whether the add-on is an overlay on the main chart or displays on a
separate chart. Default is set to
true.finalinherited - labelStyle → TextStyle
-
Text style for each level's price/delta/percentage label.
final
-
levelColors
→ List<
Color> -
The color for each entry in levels, matched by index. If shorter than
levels, colors repeat from the start.
final
-
levels
→ List<
double> -
The percentage levels of the anchor span to project as horizontal
lines, e.g.
100projects a line one full span past the start point, on the opposite side from the end point.final - lineStyle → LineStyle
-
Style of the diagonal line connecting the two anchor points.
final
- number → int
-
The number of this add-on.
finalinherited
- pattern → DrawingPatterns
-
Drawing tool line pattern: 'solid', 'dotted', 'dashed'
final
-
props
→ List<
Object> -
The list of properties that will be used to determine whether
two instances are equal.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool?
-
If set to
true, thetoStringmethod will be overridden to output this instance'sprops.no setterinherited
Methods
-
copyWith(
{String? configId, DrawingData? drawingData, LineStyle? lineStyle, LineStyle? fillStyle, DrawingPatterns? pattern, List< EdgePoint> ? edgePoints, bool? enableLabel, int? number, List<double> ? levels, List<Color> ? levelColors, TextStyle? labelStyle, bool? extendLeft, int? farXEpochOffset}) → TradeRatioDrawingToolConfig -
Creates a copy of this object.
override
-
getInteractableDrawing(
DrawingContext drawingContext, GetDrawingState getDrawingState) → TradeRatioInteractableDrawing -
Returns back the InteractableDrawing instance of this drawing tool.
override
-
getItem(
UpdateDrawingTool updateDrawingTool, VoidCallback deleteDrawingTool) → DrawingToolItem -
Creates drawing tool.
override
-
getLabelPainter(
{required Point startPoint, required Point endPoint}) → DrawingToolLabelPainter? -
Create label painter for the drawing tool.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serialization to JSON. Serves as value in key-value storage.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited