MCPcopy Create free account
hub / github.com/donkeyteethUX/iced_plot / default_hover_highlight_provider

Method default_hover_highlight_provider

src/plot_widget_builder.rs:344–362  ·  view source on GitHub ↗

Default hover highlight provider that shows the tooltip text with series label, x and y coordinates of the point.

(
        ctx: TooltipContext<'_>,
        point: &mut HighlightPoint,
    )

Source from the content-addressed store, hash-verified

342 self.with_x_tick_producer(|_, _, _| Vec::new())
343 .with_y_tick_producer(|_, _, _| Vec::new())
344 }
345
346 /// Default hover highlight provider that shows the tooltip text with
347 /// series label, x and y coordinates of the point.
348 pub fn default_hover_highlight_provider(
349 ctx: TooltipContext<'_>,
350 point: &mut HighlightPoint,
351 ) -> Option<String> {
352 if ctx.series_label.is_empty() {
353 Some(format!(
354 "x: {}, y: {}",
355 point.display_x(),
356 point.display_y()
357 ))
358 } else {
359 Some(format!(
360 "{}\nx: {}, y: {}",
361 ctx.series_label,
362 point.display_x(),
363 point.display_y()
364 ))
365 }

Callers

nothing calls this directly

Calls 1

is_emptyMethod · 0.80

Tested by

no test coverage detected