#[non_exhaustive]pub enum ChartEvent {
CrosshairMove {
point: Option<CrosshairPoint>,
},
Click {
pos: PointCss,
pane: PaneId,
logical_index: f64,
time: Option<Timestamp>,
price: f64,
target: Option<ClickTarget>,
},
VisibleRangeChanged {
from: LogicalIndex,
to: LogicalIndex,
},
NeedMoreHistory {
bars_before_start: i64,
},
DrawingCreated(DrawingId),
DrawingModified(DrawingId),
DrawingRemoved(DrawingId),
DrawingSelected(Option<DrawingId>),
Warning(WarningKind),
Sync(SyncMessage),
DrawingSync,
}Expand description
Events for the host, pulled with Chart::drain_events.
Pending CrosshairMove and VisibleRangeChanged events are coalesced: if
the host has not drained the previous one, it is replaced, so the queue
does not grow (and does not allocate) while the user interacts.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CrosshairMove
The crosshair moved; None when it left the plot or is hidden.
Fields
point: Option<CrosshairPoint>The new position.
Click
A press and release in a plot without moving more than the drag threshold (3 CSS px); not sent while a drawing is being created.
Fields
target: Option<ClickTarget>What was clicked; None for empty space.
VisibleRangeChanged
The visible logical range changed.
NeedMoreHistory
The left edge of the view is within one screen of the first bar: the
host should prepend older data. Sent once per first-bar position.
Fields
DrawingCreated(DrawingId)
A drawing was created (by the user, DrawingManager::add, or an
undo/redo that brought it back).
DrawingModified(DrawingId)
A drawing was moved or restyled.
DrawingRemoved(DrawingId)
A drawing was removed.
DrawingSelected(Option<DrawingId>)
The selection changed.
Warning(WarningKind)
A non-fatal problem.
Sync(SyncMessage)
The chart posted a message to its sync group. Hosts that sync
charts across workers forward it with Chart::apply_sync; charts
in the same SyncGroup need nothing.
DrawingSync
The chart sent drawing sync operations; hosts that forward
them to charts in other workers take them with
Chart::take_drawing_sync_ops. Reported once until they are taken.