Skip to main content

DrawingToolType

Enum DrawingToolType 

Source
#[non_exhaustive]
pub enum DrawingToolType {
Show 98 variants CrossCursor, DotCursor, ArrowCursor, Eraser, TrendLine, Ray, InfoLine, ExtendedLine, HorizontalLine, HorizontalRay, VerticalLine, CrossLine, TrendAngle, ParallelChannel, RegressionTrend, FlatTopBottom, DisjointChannel, Pitchfork, SchiffPitchfork, ModifiedSchiffPitchfork, InsidePitchfork, FibonacciRetracement, FibonacciExtension, FibonacciChannel, FibonacciTimeZones, FibonacciSpeedFan, TrendBasedFibTime, FibonacciCircles, FibonacciSpiral, FibonacciSpeedResistanceArcs, FibonacciWedge, Pitchfan, GannBox, GannSquare, GannFixed, GannFan, XABCDPattern, CypherPattern, HeadAndShoulders, ABCDPattern, TrianglePattern, ThreeDrivesPattern, ElliottImpulse, ElliottCorrection, ElliottTriangle, ElliottDoubleCombo, ElliottTripleCombo, CyclicLines, TimeCycles, SineLine, LongPos, ShortPos, Forecast, BarsPattern, GhostFeed, ProjectionTool, AnchoredVWAP, FixedRangeVolumeProfile, AnchoredVolumeProfile, Measure, PriceRange, DateRange, DateAndPriceRange, Brush, Highlighter, ArrowMarker, Arrow, ArrowMarkUp, ArrowMarkDown, ArrowMarkLeft, ArrowMarkRight, Rect, RotatedRect, Path, Circle, Ellipse, Polyline, Triangle, Sector, Arc, Curve, DoubleCurve, TextLabel, AnchoredText, Note, PriceNote, AnchoredNote, Table, Callout, Comment, PriceLabel, Signpost, FlagNote, Image, Tweet, Idea, FontIcon, Sticker,
}
Expand description

Enumeration of all drawing tool types available in the charting engine.

Identifies a drawing’s rendering behavior, interaction mode, required point count and toolbar placement. Use categories and by_category to build a categorized picker.

§Interaction modes

interaction_mode describes how a tool captures points; required_points gives its completion count, or None for tools without a fixed count.

§Parsing

DrawingToolType implements FromStr with flexible case-insensitive matching, including common abbreviations:

let tool: DrawingToolType = "fib".parse().unwrap();
assert_eq!(tool, DrawingToolType::FibonacciRetracement);

Serde writes and reads the variant name ("FibonacciRetracement"), which stays stable when display names change.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

CrossCursor

Crosshair cursor overlay – not a drawing, provides precision targeting.

§

DotCursor

Dot cursor overlay – minimal cursor for clean chart views.

§

ArrowCursor

Standard arrow/pointer cursor.

§

Eraser

Eraser tool – click on drawings to delete them.

§

TrendLine

A line segment between two points (click-click interaction).

§

Ray

A ray starting at a point and extending infinitely in one direction.

§

InfoLine

An info line showing distance, angle, and bar count between two points.

§

ExtendedLine

A line that extends infinitely in both directions through two points.

§

HorizontalLine

A horizontal line at a specific price level, extending across the chart.

§

HorizontalRay

A horizontal ray extending from a point to the right edge of the chart.

§

VerticalLine

A vertical line at a specific bar/time, extending top to bottom.

§

CrossLine

Combined horizontal + vertical crosshair lines at a single point.

§

TrendAngle

A trend line that displays the angle of the line in degrees.

§

ParallelChannel

Two parallel lines defining a price channel (3-point: two on baseline, one for width).

§

RegressionTrend

Linear regression channel with standard deviation bands.

§

FlatTopBottom

A trend line through the first two anchors and a horizontal line at the third anchor’s price.

§

DisjointChannel

Two lines over the first two anchors’ bars with opposite slopes; the third anchor positions the mirrored line.

§

Pitchfork

Andrews’ Pitchfork – median line with parallel support/resistance (3-point).

§

SchiffPitchfork

Schiff Pitchfork variant with adjusted median line start point.

§

ModifiedSchiffPitchfork

Modified Schiff Pitchfork with further median line adjustment.

§

InsidePitchfork

Inside Pitchfork – median line drawn inside the price action.

§

FibonacciRetracement

Fibonacci retracement levels between two price points (drag-to-draw).

§

FibonacciExtension

Trend-based Fibonacci extension projecting levels beyond the measured move.

§

FibonacciChannel

Fibonacci channel with parallel lines at Fibonacci ratios.

§

FibonacciTimeZones

Vertical time zones at Fibonacci number intervals from a start point.

§

FibonacciSpeedFan

Fibonacci speed/resistance fan with diagonal lines at Fibonacci angles.

§

TrendBasedFibTime

Trend-based Fibonacci time projections using price swing timing.

§

FibonacciCircles

Concentric circles at Fibonacci ratio radii.

§

FibonacciSpiral

Golden spiral (logarithmic spiral based on the golden ratio).

§

FibonacciSpeedResistanceArcs

Arcs at Fibonacci speed/resistance levels.

§

FibonacciWedge

Fibonacci wedge – converging lines at Fibonacci angles.

§

Pitchfan

Pitch fan – fan lines at specific angle ratios from a pivot point.

§

GannBox

Gann Box – a grid of price/time squares using Gann ratios.

§

GannSquare

Gann Square – W.D. Gann’s square of nine overlay.

§

GannFixed

Gann Square Fixed – fixed-size Gann grid.

§

GannFan

Gann Fan – fan lines at standard Gann angles (1x1, 1x2, 2x1, etc.).

§

XABCDPattern

XABCD harmonic pattern (5-point: Gartley, Butterfly, Bat, Crab, etc.).

§

CypherPattern

Cypher harmonic pattern (5-point variant with specific ratio rules).

§

HeadAndShoulders

Head and Shoulders reversal pattern (7-point).

§

ABCDPattern

ABCD harmonic pattern (4-point geometric price pattern).

§

TrianglePattern

Triangle chart pattern (ascending, descending, or symmetrical; 7-point).

§

ThreeDrivesPattern

Three Drives harmonic pattern (6-point repeating impulse pattern).

§

ElliottImpulse

Elliott impulse wave: a start point and waves 1 to 5 (6 points).

§

ElliottCorrection

Elliott correction wave: a start point and waves A, B and C (4 points).

§

ElliottTriangle

Elliott triangle: a start point and waves A to E (6 points).

§

ElliottDoubleCombo

Elliott double combination: a start point and waves W, X and Y (4 points).

§

ElliottTripleCombo

Elliott triple combination: a start point and waves W, X, Y, X and Z (6 points).

§

CyclicLines

Evenly-spaced vertical lines highlighting cyclic time intervals.

§

TimeCycles

Circular time cycle arcs projected from a start point.

§

SineLine

Sine wave curve between two points, for cyclical analysis.

§

LongPos

Long position risk/reward tool showing entry, stop loss, and take profit.

§

ShortPos

Short position risk/reward tool showing entry, stop loss, and take profit.

§

Forecast

Forecast/prediction zone projected from two points.

§

BarsPattern

Bars pattern – copy and project a price pattern forward in time.

§

GhostFeed

Ghost feed – translucent historical price overlay for comparison.

§

ProjectionTool

Generic projection tool for price/time forecasting.

§

AnchoredVWAP

Anchored VWAP (Volume-Weighted Average Price) from a user-selected bar.

§

FixedRangeVolumeProfile

Fixed-range volume profile histogram between two time points.

§

AnchoredVolumeProfile

Anchored volume profile starting from a user-selected bar.

§

Measure

Ruler/measure tool showing distance, bars, and percentage between two points.

§

PriceRange

Price range highlight (vertical span at a price zone).

§

DateRange

Date range highlight (horizontal span across a time period).

§

DateAndPriceRange

Combined date-and-price range rectangle.

§

Brush

Freehand drawing brush (continuous-draw interaction). Drawings saved with the former Paintbrush tool, which drew the same, load as brushes.

§

Highlighter

Semi-transparent highlighter brush for marking chart regions.

§

ArrowMarker

Two-point directional arrow marker.

§

Arrow

Two-point arrow with customizable head styles.

§

ArrowMarkUp

Upward arrow marker (single-click, bullish signal).

§

ArrowMarkDown

Downward arrow marker (single-click, bearish signal).

§

ArrowMarkLeft

Leftward arrow mark placed with one click at its tip.

§

ArrowMarkRight

Rightward arrow mark placed with one click at its tip.

§

Rect

Axis-aligned rectangle defined by two corner points.

§

RotatedRect

Rectangle that can be rotated to any angle.

§

Path

Multi-segment path ending in an arrowhead.

§

Circle

Circle defined by center and edge point.

§

Ellipse

Ellipse defined by bounding rectangle corners.

§

Polyline

Open polyline with unlimited points (double-click to finish).

§

Triangle

Triangle defined by three corner points.

§

Sector

Circular sector: center, radius endpoint, then end ray, swept clockwise on screen.

§

Arc

Circular arc between two points with adjustable curvature.

§

Curve

Quadratic Bezier curve (3 control points: start, control, end).

§

DoubleCurve

Cubic Bezier curve (4 control points).

§

TextLabel

Simple text label placed on the chart.

§

AnchoredText

Text label anchored to screen position (doesn’t move with pan).

§

Note

Note: a text label joined to the bar and price it annotates by a thin line.

§

PriceNote

Price note: the anchor’s price and any text in a solid label, joined to the anchor by a thin line.

§

AnchoredNote

Pin: a marker on a bar and price, with its text in a popup while selected.

§

Table

Data table overlay on the chart.

§

Callout

Callout with arrow pointing to a chart location.

§

Comment

Comment: its text in one bubble with a corner on the anchor.

§

PriceLabel

Price label: the anchor’s price in a badge beside the point, with a pointer to it.

§

Signpost

Signpost: a label on a thin pole above or below its bar.

§

FlagNote

Flag/mark note at a specific chart location.

§

Image

Image embed identifier; built-in rendering draws a frame without loading an image.

§

Tweet

Social post embed identifier; built-in rendering draws a card without fetching content.

§

Idea

Idea embed identifier; built-in rendering draws a badge without fetching content.

§

FontIcon

Bundled vector icon or Unicode emoji placed at a single point.

§

Sticker

Bundled illustrated sticker placed with one click, sized by Drawing::font_size.

Implementations§

Source§

impl DrawingToolType

Source

pub fn is_cursor(&self) -> bool

Returns true if this tool is a cursor/utility tool rather than a drawing tool.

Cursor tools (CrossCursor, DotCursor, ArrowCursor, Eraser) do not create Drawing objects. They modify the cursor appearance or provide utility functions (e.g., erasing).

Source

pub fn supports_fill(&self) -> bool

Whether the renderer paints a filled area that takes the drawing’s fill colour.

Source

pub fn supports_extend(&self) -> bool

Whether the drawing’s left and right extension flags change its geometry.

Source

pub fn supports_text(&self) -> bool

Whether the renderer displays the drawing’s editable text.

Source

pub fn supports_line_ends(&self) -> bool

Whether the renderer draws the drawing’s line start and line end styles.

Source

pub fn supports_middle_line(&self) -> bool

Whether the renderer draws a middle line when the drawing’s middle line flag is on.

Source

pub fn edits_text_inline(&self) -> bool

Whether a double click edits the drawing’s text in place instead of opening its settings.

Source

pub fn interaction_mode(&self) -> DrawingInteractionMode

Returns the DrawingInteractionMode that governs how mouse input is captured when creating a drawing of this type.

See DrawingInteractionMode for details on each mode.

Source

pub fn required_points(&self) -> Option<usize>

Returns the number of points placed to complete a drawing of this type, or None for tools with no fixed count (Polyline, Path, Brush, cursors). Some tools store more anchors than they are placed with: a long or short position adds its target and stop, three anchors in all, and a curve and a double curve add their controls between their ends, three and four. A bars pattern adds its copy anchor, three anchors in all.

ModeTypical count
SingleClick1
ClickClick / DragToDraw2
MultiPoint2 to 7 depending on tool
ContinuousDrawNone (unlimited)
NotDrawingNone
Source§

impl DrawingToolType

Source

pub fn by_category(category: &str) -> Vec<Self>

Returns all tools belonging to the given category (case-insensitive).

Valid category names: "cursors", "lines", "channels", "pitchforks", "fibonacci", "gann", "patterns", "elliott", "cycles", "projection", "volume", "measurers", "brushes", "arrows", "shapes", "annotations", "content", "icons".

Returns an empty vector for an unknown category name.

Source

pub fn categories() -> &'static [&'static str]

Returns the names of all 18 tool categories in display order.

These are the finer command-list groups, not the toolbar menu groups defined by drawings::categories.

Source

pub fn all() -> &'static [Self]

Returns a static slice of all tool types in canonical order.

The order matches the category groupings: cursors, lines, channels, pitchforks, fibonacci, gann, patterns, elliott, cycles, projection, volume, measurers, brushes, arrows, shapes, annotations, content, icons.

Source

pub fn icon(&self) -> &str

Returns the relative path to the SVG icon file for this tool.

Paths are relative to the application’s asset root (e.g., "assets/icons/drawing/trend-line.svg"). Used by the toolbar UI to display tool icons.

Source§

impl DrawingToolType

Source

pub fn as_str(&self) -> &str

Returns a human-readable display name for the tool (e.g., "Trend Line", "Fib Retracement").

This is the string shown in the toolbar UI and in the Display implementation. Each tool has its own name, and FromStr parses it back to the same tool, ignoring case.

Source

pub fn data_name(&self) -> &str

Returns the data-name identifier for the tool.

These identifiers (e.g., "LineToolTrendLine", "LineToolFibRetracement") follow the common LineTool* naming convention for drawing tools and are used for serialization/protocol compatibility.

Trait Implementations§

Source§

impl Clone for DrawingToolType

Source§

fn clone(&self) -> DrawingToolType

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for DrawingToolType

Source§

impl Debug for DrawingToolType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DrawingToolType

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for DrawingToolType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for DrawingToolType

Source§

impl FromStr for DrawingToolType

Source§

type Err = ParseToolTypeError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for DrawingToolType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for DrawingToolType

Source§

fn eq(&self, other: &DrawingToolType) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for DrawingToolType

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for DrawingToolType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AsId for T
where T: Hash + Debug,

§

impl<T> AsIdSalt for T
where T: Hash + Debug,

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> MaybeSend for T
where T: Send + Sync + ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,

§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.