Skip to content

Conversation

@michalsustr
Copy link
Collaborator

@michalsustr michalsustr commented Dec 13, 2025

Now you can have one without the other. Addresses #217

Public API changes

The PlotItem label formatter is now optional:

-pub fn egui_plot::PlotItem::on_hover(&self, plot_area_response: &egui::response::Response, elem: egui_plot::ClosestElem, shapes: &mut alloc::vec::Vec<epaint::shapes::shape::Shape>, cursors: &mut alloc::vec::Vec<egui_plot::Cursor>, plot: &egui_plot::PlotConfig<'_>, label_formatter: &egui_plot::LabelFormatter<'_>)
+pub fn egui_plot::PlotItem::on_hover(&self, plot_area_response: &egui::response::Response, elem: egui_plot::ClosestElem, shapes: &mut alloc::vec::Vec<epaint::shapes::shape::Shape>, cursors: &mut alloc::vec::Vec<egui_plot::Cursor>, plot: &egui_plot::PlotConfig<'_>, label_formatter: &core::option::Option<egui_plot::LabelFormatter<'_>>)

Allow to specify crosshair:

+pub fn egui_plot::Plot<'a>::show_crosshair(self, show: bool) -> Self
+pub egui_plot::PlotConfig::show_crosshair: bool

Add default formatter:

+pub fn egui_plot::default_label_formatter(name: &str, value: &egui_plot::PlotPoint) -> alloc::string::String

And by default, labels are not shown. You have to enable it by passing label_formatter(you_label_formatter)
You can use the default_label_formatter.

@michalsustr michalsustr added the include in changelog This change will be included in the changelog label Dec 13, 2025
@github-actions
Copy link

View snapshot changes at kitdiff

@michalsustr michalsustr marked this pull request as ready for review December 13, 2025 13:37
@michalsustr michalsustr merged commit ed3d2c2 into main Dec 13, 2025
10 checks passed
@michalsustr michalsustr deleted the ms/show-without-labels branch December 13, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

include in changelog This change will be included in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants