#[non_exhaustive]pub enum ChartEvent {
Show 17 variants
EventsDropped(usize),
VisibleRangeChanged(Option<VisibleTimeRange>),
VisibleLogicalRangeChanged(Option<LogicalRange>),
TimeScaleResized(Vec2),
CrosshairMoved(Option<ChartPointer>),
Click {
position: ChartPointer,
button: PointerButton,
},
DoubleClick {
position: ChartPointer,
},
MarkClick {
id: String,
series: SeriesId,
time: DateTime<Utc>,
},
LinkClick {
drawing: usize,
link: String,
},
ImageRequested(ImageRequest),
DataLoaded {
series: SeriesId,
bars: usize,
},
DataUpdated {
series: SeriesId,
bars: usize,
},
DataOperation {
series: SeriesId,
operation: DataOperation,
bars: usize,
},
SymbolChanged(String),
TimeframeChanged(Timeframe),
SeriesAdded(SeriesId),
SeriesRemoved(SeriesId),
}Expand description
A notification for the host. Existing selection and action polling APIs remain independent.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EventsDropped(usize)
Oldest notifications dropped because the host did not drain the 1024-entry queue. Emitted first on the next drain; read the current chart state to recover.
VisibleRangeChanged(Option<VisibleTimeRange>)
The UTC plot edges changed; None means there is no data to map.
VisibleLogicalRangeChanged(Option<LogicalRange>)
The visible logical range changed, as Chart::visible_logical_range returns it,
including changes of bar spacing alone; None means there is no data.
TimeScaleResized(Vec2)
The time axis changed size, as Chart::time_scale_size returns it, including its
first non-zero size.
CrosshairMoved(Option<ChartPointer>)
The local cursor moved or anything its pointer carries changed, such as the bar under a
stationary cursor or a held modifier; None means it left the plots or no eligible
crosshair index remains in view.
Programmatically synchronized cursors do not emit this event.
Click
A primary or secondary click in a plot, including clicks selecting drawings or studies.
Fields
position: ChartPointerClick location in the pane’s units.
The button released to complete the click.
DoubleClick
A primary double click in a plot, after the Self::Click of each of its clicks.
Fields
position: ChartPointerLocation of the second click.
MarkClick
A primary click on a bar mark with a host ID. Of overlapping marks the one painted on top is reported, and the click selects nothing else.
Fields
id: StringThe Marker::id the host gave the mark.
series: SeriesIdThe series the mark belongs to; SeriesId::MAIN for the main series.
LinkClick
A primary click on the Open row of a post or idea card with a link. Open the post or idea it names; the link may be any text the user typed, so check it, such as its scheme, before opening it. The click also selects the card, as any click on it does.
ImageRequested(ImageRequest)
The user placed an image or dropped picture files on the price pane. Answer with
Chart::set_drawing_image; until then the image shows its placeholder.
DataLoaded
A successful history page or set_data completed, including an empty result.
Live updates emit DataUpdated instead; failed or obsolete feed replies emit nothing.
Fields
DataUpdated
A live bar from update or the chart’s feed changed the bars of a series, or pop_bars
removed some. Changes of one series in a row are reported once, with the latest count.
Fields
DataOperation
One accepted set_data or update call, when enabled with
Chart::set_data_operation_notifications. Never coalesced; additional to the compact
DataLoaded and DataUpdated events. Feed replies, removals and constructor data do not
emit this event. Overflow is reported by EventsDropped as for other notifications.
Fields
operation: DataOperationThe operation and, for an update, its incoming bar time.
SymbolChanged(String)
The symbol setter accepted a different symbol.
TimeframeChanged(Timeframe)
The interval setter accepted a different interval.
SeriesAdded(SeriesId)
An added bar series joined the chart: through Chart::add_series or
Chart::add_comparison, a restored snapshot, or undo or redo bringing back a series.
Undo and redo keep its id, options, visibility, pane, scale, markers, price lines,
price formatter, bar limit and bars, under the current replay cutoff. Supply current
bars with Chart::set_data and resume Chart::update. Snapshot restore assigns
new ids and leaves supplying bars to the host.
SeriesRemoved(SeriesId)
An added bar series left the chart: through Chart::remove_series or
Chart::remove_pane, the pane menu, a restored snapshot, or undo or redo of the edit
that added it. Data sent for it is ignored from then on. Undo or redo can bring it back
with the same id, so keep what the host needs to feed it again.
Trait Implementations§
Source§impl Clone for ChartEvent
impl Clone for ChartEvent
Source§fn clone(&self) -> ChartEvent
fn clone(&self) -> ChartEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChartEvent
impl Debug for ChartEvent
Source§impl PartialEq for ChartEvent
impl PartialEq for ChartEvent
impl StructuralPartialEq for ChartEvent
Auto Trait Implementations§
impl !RefUnwindSafe for ChartEvent
impl !UnwindSafe for ChartEvent
impl Freeze for ChartEvent
impl Send for ChartEvent
impl Sync for ChartEvent
impl Unpin for ChartEvent
impl UnsafeUnpin for ChartEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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